Forum Moderators: coopster
Alright I have an easy question. For some reason my stupid script will not work and its annoying me because I know its an easy answer, but I just don't know it.
Basically, I am trying to delete something from a table using a string variable.
$tsremove = "Available for All Windows Platforms";
$tscat = "solutions";
mysql_query("DELETE FROM techspecs_'$tscat' WHERE '$tscat' = '".$tsremove."'");
So the mysql_query should be DELETE FROM techspecs_solutions where solutions = "Available for All Windows Platforms";
What exactly am I doing wrong? Sorry for asking such a noob question :P
Wes
$sql = "DELETE FROM techspecs_'$tscat' WHERE '$tscat' = '".$tsremove."'";
exit($sql); // get rid of this line after troubleshooting!
mysql_query($sql);
It will output this...
DELETE FROM techspecs_'solutions' WHERE 'solutions' = 'Available for All Windows Platforms'
Now you can start fixing your statement...