Reputation: 109
$querychange =
mysql_query("UPDATE table SET clounm='$newvale' WHERE email='$email'")
but put $newvalue into the nearest empty cell
Upvotes: 0
Views: 16088
Reputation: 556
Is this what your looking for
UPDATE table SET clounm='$newvale' WHERE email IS NULL LIMIT 1
Upvotes: 0
Reputation: 1954
Consider the following code:
UPDATE `table_name` SET `col_name` = `col_value` WHERE `record_name` = 'ID'
for example
UPDATE `student` SET `marks` = 50 WHERE `name` = 'Jack'
This will set all records with name Jack to 50 marks.
Upvotes: 1