Reputation: 1632
Can't I use double condition in where clause in query. LIke I have used query..
mysql_query("DELETE * FROM srelsg WHERE skey='".$childid."' AND sgkey='".$sgid."' ") or die(mysql_error());
but its giving me syntax error. Might be I am using double variables in WHERE for delete query. Any other solution I can do it. Because combination of both variable make my tupple unique. else both field exist number of times.
Upvotes: 1
Views: 43
Reputation: 59997
In addtion to Mark Byers - use mysql_real_escape_string
http://php.net/manual/en/function.mysql-real-escape-string.php
Upvotes: 0
Reputation: 838006
There should not be a *
between DELETE
and FROM
. Change this:
DELETE * FROM srelsg WHERE ...
To this:
DELETE FROM srelsg WHERE ...
See the DELETE
syntax in the MySQL manual.
Upvotes: 6