-5

Someone gave me this query to delete community from a database on my server using phpMyAdmin, it worked when he use it so I asked him to send it to me, but I get a error

MySQL said:

Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"SELECT * FROM `connections` WHERE 1" :
delete from connections where communit' at line 1

I did a search on the error but could not figure it out.

"SELECT * FROM `connections` WHERE 1" :
delete from connections where community="XYZ"
0

2 Answers 2

2

You should separate your queries with ; and not :

1
  • Thank you that was one of the problems
    – xyz
    Oct 29, 2014 at 15:10
0

The error you are receiving as you've shown it is because this line is incorrect:

SELECT * FROM `connections` WHERE 1"

First because it's ending in an unnecessary double quotation mark. MySQL does not use double quotes but single quotes, and even still the other single quote is not there to match it.

The single quotes are also a problem for community="XYZ", this should read: community = 'XYZ'

Secondly, you don't have a condition for your where statement, you must be missing something like:

WHERE columnName = 1;

If you were trying to select everything from connections, you can just remove that where clause all together.

EDIT

In addition, MySQL queries are separated by a semi-colon, not a colon, so MySQL will not realize you are trying two different queries.

2
  • Thank you as you called out there were two problems the : and the ". I can't imagine why someone down grated your answer?
    – xyz
    Oct 29, 2014 at 15:09
  • @Tim well, you can't win them all. Glad I could help!
    – AdamMc331
    Oct 29, 2014 at 16:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.