I'm trying to make a command to delete some mysql rows in a script.
The code I use is:
$subcats = catDelete($cat_id); // gets the subcategories of the top category echo $subcats; // just a test to see that it outputs the right code echo '<br>'. $cat_id; // just a test to see the the $cat_id variable has not been changed $db = mysql_connect($server_name,$user,$password); @mysql_select_db($database) or die( "Unable to select database"); mysql_query("DELETE FROM categories WHERE $subcats cat_id = $cat_id",$db) or die(mysql_error()); echo $lang_info_del; // echos that the categories and subcategories has been deleted
echo commands are to make sure I get the right code for the mysql query that deletes the rows
cat_id=71 AND cat_id=72 AND
When I try to delete a category that has sub categories rows are not getting deleted
When I try to delete a category with no subcategories the command is executed and the row gets deleted.
Thanks in advance!