1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Development SQL question/help

Discussion in 'Software' started by Headspark, 11 Oct 2005.

  1. Headspark

    Headspark Minimodder

    Joined:
    23 Feb 2005
    Posts:
    403
    Likes Received:
    2
    http://www.29er.org.uk/css/index.php

    Just creating this website. could someone help me with my SQL.

    PHP:
    $query="SELECT * FROM 29ersite_home WHERE feature = 0 and show = 1 ORDER by id DESC";
    I just get the error message that is shown on the site. Yes there is contents, and when i remove the AND and one of the arguments it works as i would expect it to.

    Cheers

    Andy
     
  2. SJH

    SJH Minimodder

    Joined:
    24 Dec 2003
    Posts:
    1,427
    Likes Received:
    5
    I think show is a SQL reserved word. Try renaming the field to something else and see if that works :)
     
  3. Dad

    Dad You talkin to me?

    Joined:
    15 Apr 2003
    Posts:
    5,375
    Likes Received:
    8
    SHOW is indeed reserved word for SQL. Try putting show in single quotes and it may see it as a variable or string.

    "SELECT * FROM 29ersite_home WHERE feature = 0 and 'show' = 1 ORDER by id DESC"
     
  4. Headspark

    Headspark Minimodder

    Joined:
    23 Feb 2005
    Posts:
    403
    Likes Received:
    2
    i thank you!
     
  5. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    edit: see SJH's post :D
     
  6. Dad

    Dad You talkin to me?

    Joined:
    15 Apr 2003
    Posts:
    5,375
    Likes Received:
    8
    Wiser words have never been said ;)
     
  7. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
  8. acidfire

    acidfire What's a Dremel?

    Joined:
    11 May 2004
    Posts:
    259
    Likes Received:
    0
    is it me or does this site look awfully familiar....
     
    Last edited: 12 Oct 2005
  9. SJH

    SJH Minimodder

    Joined:
    24 Dec 2003
    Posts:
    1,427
    Likes Received:
    5
    Haha I didn't notice that to start with ;)
     
  10. Malaniken

    Malaniken What's a Dremel?

    Joined:
    23 Apr 2005
    Posts:
    7
    Likes Received:
    0
    Imitation is the sincerest form of flattery :hehe:
     
  11. Headspark

    Headspark Minimodder

    Joined:
    23 Feb 2005
    Posts:
    403
    Likes Received:
    2
    indeed, well i do spend a few too many hours reading this site, and love it.

    Its also not a complete copy, you goto love my graphics!
     

Share This Page