mysql error You have an error in your SQL syntax near.....
Posted: Thu Jun 12, 2003 5:25 pm
I keep getting this error that I have an error in my SQL syntax near line 1:
You have an error in your SQL syntax near '* FROM products WHERE id = 41' at line 1
here's the code around that region:
the id is taken from a hidden field within a form. That hidden field gets its value from the get variable in the URL. Now I thought you could delete an entire MYSQL row at once and this was the syntax I thought you used, but I guess I'm wrong?
If anyone knows what may be causing this please respond ASAP
You have an error in your SQL syntax near '* FROM products WHERE id = 41' at line 1
here's the code around that region:
Code: Select all
<?php
if (isset($_POST['delete_yes'])) {
$_POST['id'] = $id;
$delete_query = "DELETE * FROM products WHERE id = $id";
$do_delete_query = mysql_query($delete_query) or die(mysql_error());
echo ("Successfully deleted product.<BR><BR>");
echo ("<a href='index.php'>Return to Product DB Admin.</a>");
}
?>If anyone knows what may be causing this please respond ASAP