Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-08-2008, 11:34 PM   PM User | #1
ole90
Regular Coder

 
Join Date: Jan 2007
Posts: 217
Thanks: 9
Thanked 0 Times in 0 Posts
ole90 is an unknown quantity at this point
Whats wrong with this query :X?

It keeps giving me an error so i echo'd it out but i can't find anything wrong with it. Can you :X?

PHP Code:
SELECT FROM `gm_hmWHERE `ID` = '4', `l1` = 'o', `l2` = 'l', `l3` = 'e', `l4` = '_', `l5` = 'l', `l6` = 'i', `l7` = 'k', `l8` = 'e', `l9` = 's', `l10` = '_', `l11` = 'c', `l12` = 'a', `l13` = 'k', `l14` = 'e', `l15` = '_', `l16` = '_', `l17` = '_', `l18` = '_', `l19` = '_', `l20` = '_', `l21` = '_', `l22` = '_', `l23` = '_', `l24` = '_', `l25` = '_'


You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ' `l1` = 'o', `l2` = 'l', `l3` = 'e', `l4` = '_', `l5` = 'l', `l6` = 'i', `l7` = ' at line 1 
ole90 is offline   Reply With Quote
Old 08-08-2008, 11:37 PM   PM User | #2
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Instead of comma's, you should be using AND or OR, depending on what you're trying to do.
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 08-09-2008, 03:18 AM   PM User | #3
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
As nightfire said, do it like this.

Code:
SELECT * FROM `gm_hm` WHERE `ID` = '4' AND `l1` = 'o' AND `l2` = 'l' AND `l3` = 'e' AND
masterofollies is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:21 AM.


Advertisement
Log in to turn off these ads.