Results 1 to 3 of 3
March 5th, 2005, 11:25 AM #1How can I do this?
I'm trying to write a bit of php script that I can run and it will delete from my database any lines/products that meet into the criteria. In this case below I am looking to delete all lines/products that do not have anything in the maincat field. I am not having any luck at all trying to get it to work. Can anyone tell/explain to me what I am doing wrong please?
Thanks in advance.
$sql = mysql_query("SELECT * FROM databasename WHERE maincat = ' ' ") or die(mysql_error());
$sql = ("DELETE (*) FROM databasename WHERE maincat = ' ' ");
March 5th, 2005, 11:31 AM #2
mysql_query("delete FROM databasename WHERE maincat = ' ' ") or die(mysql_error());
Should do it for you
March 5th, 2005, 02:25 PM #3
Thanks Chris I was going mad trying to figure this out