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~

Edited by FoxRocks
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.