1

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.

2 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

Comments

0

In addtion to Mark Byers - use mysql_real_escape_string

http://php.net/manual/en/function.mysql-real-escape-string.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.