Freedom-n-Democrazy Posted September 12, 2011 Share Posted September 12, 2011 I have this table: +------+---------------+------------+ | id | primarycolour | pricerange | +------+---------------+------------+ | 1 | black | 1 | | NULL | brown | 2 | +------+---------------+------------+ I want to delete the entire entry for NULL. I tried this, but it didn't work: delete from testdb.products where id='NULL'; How can it be done? Also, I don't think saying "deleting an entire entry of data" is correct. Is what I am asking to do is to delete a primary key? Link to comment https://forums.phpfreaks.com/topic/246950-deleting-an-entire-entry-of-data/ Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2011 Share Posted September 12, 2011 close, but by using ='NULL' you are saying "where the field contains a thext string 'NULL' what you need is delete from testdb.products where id IS NULL; Link to comment https://forums.phpfreaks.com/topic/246950-deleting-an-entire-entry-of-data/#findComment-1268276 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.