whats wrong with this?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Mh_0
New php-forum User
New php-forum User
Posts: 11
Joined: Thu Nov 14, 2002 7:13 am
Location: UK
Contact:

whats wrong with this?

Postby Mh_0 » Tue Jan 21, 2003 3:51 am

$sql = "DELETE FROM `sme` WHERE (`PI`='' && `Details`='' && `location`='')";
mysql_query($sql)or die("<b>Query Failed</b><br>\n".$sql."<br>\n".mysql_errno().": ".mysql_error());
}

the error message is:

Query Failed
DELETE FROM `sme` WHERE
1064: You have an error in your SQL syntax near '' at line 1

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Tue Jan 21, 2003 6:11 am

Try using this syntax:

Code: Select all

mysql_query " DELETE FROM sme WHERE PI='$my_pi' and Details='$my_details' and location='$my_location' ";

I think you are missing some info in the sample...


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests