I cannot for the life of me get this to work with my web site.
I get that error with the following code:Code:Invalid query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '=' at line 1
I've also tried the followingCode:if ($_POST['delete'] == "news" || "articles"){ $data = array($_POST['delete'], $_POST['id']); $result = mysql_query("DELETE FROM $data[0] WHERE ID =$data[1]"); if (!$result) { die('Invalid query: ' . mysql_error());}
andCode:if ($_POST['delete'] == "news" || "articles"){ $data = array($_POST['delete'], $_POST['id']); $result = mysql_query("DELETE QUICK FROM $data[0] WHERE ID =$data[1]"); if (!$result) { die('Invalid query: ' . mysql_error());}
I've also tried encapsulating my php variables and my column names with single quotes to no avail.Code:if ($_POST['delete'] == "news" || "articles"){ $data = array($_POST['delete'], $_POST['id']); $result = mysql_query("DELETE FROM $data[0] WHERE ID IN($data[1])"); if (!$result) { die('Invalid query: ' . mysql_error());}
This code works without issue with my blogging software I made a long time ago... at least I thought it did but I don't even remember anymore. I'd have to double check




Reply With Quote