how to update multple rows in mysql with php -
i have table this
id | website | ping | online | ------------------------------- 1 |xxxx.com | 30 | 1 ------------------------------- 4 |xxxx.com | 46 | 1 ------------------------------- 5 |xxxx.com | 10 | 0 ------------------------------- 8 |xxxx.com | 90 | 1 ------------------------------- 11 |xxxx.com | 200 | 0
i want know how update ping , online rows in table without changing id , website have ping , online functions
you going have read entire table, , iterate through recordset, getting id , using update table new value id.
something (pseudocode)
records = db.executesql("select * table"); foreach record in records $id = record.id $whateverping = new ping id=$id $whateveronline = new online id=$id result = db.executesql("update table set ping=$whateverping, online=$whateveronline id=$id);
Comments
Post a Comment