Jump to content

Mysql Where Syntax Help


FoxRocks

Recommended Posts

Hello,

 

I'm trying to do a simple database query and I keep getting an error saying:

 

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 'group='sales'' at line 1

 

I am absolutely stumped, I have used this exact syntax before and it worked just fine! and it works perfectly if I take out that one section group='sales'

 

Here is my code:

 

$result = mysql_query("SELECT * FROM faq WHERE group='sales' ");

 

I have a table, named faq with four columns in it...id, question, answer, group. I have checked to make sure I have data in the table and that all the spelling is correct and everything checks out. I have one entry in the "group" column that has "sales" in it and I'm trying to retrieve the "questions" and "answers" for a simple FAQ page.

 

BTW, I realize this is a PHP form and I'm asking about Mysql syntax, I hope that's alright?

 

Also, if I left something out please just let me know and I'll get right back to you.

 

Thank you SO much for any direction or help you can give me, I'm at a complete loss!!

 

~FOX~

Link to comment
https://forums.phpfreaks.com/topic/268773-mysql-where-syntax-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.