Posted: Mon Nov 27, 2006 10:25 am
what is that supposed to mean? it's still passing the same information the same way... my debug output shows that $c is printing the values of the uID's that i want to be deleted. it's printed the same exact way in the sql query. so i don't understand what you mean? can you explain?Burrito wrote:the uid looks to be alphanumeric, you'll need to quote that in your sql statement. If you put some error checking in your mysql_query() as has been suggested, you'd see this.
here's the code now.
Code: Select all
if($_POST['delete'] != NULL){
foreach($_POST['delete'] as $k => $c){
echo $k ." / ". $c ." || "; //<-- prints the EXACT correct information for the sql query to be properly executed.
$sql = "DELETE * FROM my_search_table WHERE uID = ". $c ."";
mysql_query($sql) OR die ("The query:<br>" . $sql . "<br>Caused the following error:<br>" . mysql_error());
}
}Code: Select all
0 / 7djtV0nIPaui9Wt7WkIUBts2M3b3bh || The query:
DELETE * FROM my_search_table WHERE uID = 7djtV0nIPaui9Wt7WkIUBts2M3b3bh
Caused the following error:
You have an error in your SQL syntax near '* FROM my_search_table WHERE uID = 7djtV0nIPaui9Wt7WkIUBts2M3b3bh' at line 1