Posted by J B Carr on 09/28/60 11:37
php coder wrote:
> Sorry, this is simple... but i'm going cross-eyed trying to find the
> error:
> This code:
> $delete_query = "DELETE FROM $tablename WHERE index = '$index'";
> if($delete){
> mysql_query($delete_query) or die(mysql_error());
> }
>
> is throwing this error:
> Couldn't run query: You have an error in your SQL syntax near 'index =
> 15' at line 1
>
> And everything I'm referencing says the coding is correct.
> Any ideas? suggestions?
>
> Thanks!
>
I suggest:
$q = "Delete from" . $tbl_name . " where index=" . $index; //if index an
integer, or
$q = "Delete from" . $tbl_name . " where index='" . $index . "'"; //if
index a string
Navigation:
[Reply to this message]
|