Page 1 of 1

Deleting one item from one row?

Posted: Mon Jan 15, 2007 3:08 am
by cturner
I am wondering if someone could please tell me how I can delete one item from one row with mysql? Thanks in advance.

Posted: Mon Jan 15, 2007 3:33 am
by GM

Code: Select all

UPDATE table_name SET item_to_delete = NULL WHERE ...
The WHERE statement needs to contain a combination of columns/values that uniquely identify the row you need to change.

If NULL doesn't work, it means the column is set up to not accept NULL, in which case the best you can do is to change it to '' (blank string), or 0 (in case of integer)