Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    217
    Thanks
    9
    Thanked 0 Times in 0 Posts

    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 

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Instead of comma's, you should be using AND or OR, depending on what you're trying to do.

  • #3
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •