SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL Query Syntax Error

    I'm getting a syntax error when I try to run the following SQL query:

    Code:
    SELECT link_content.url AS url, link_content.title AS title, link_content.description AS description, link_categories.id AS catid
     WHERE link_content.category_id = link_categories.id
     AND link_categories.path_name = 'search-engine-optimisation'
     ORDER BY title ASC
    The exact error is:

    Code:
    #1064 - 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 'WHERE link_content.category_id = link_categories.id
     AND link_c
    I'm sure this is something simple that I've overlooked, but I would appreciate any help you might be able to give me

    -Sam
    Sam Hastings

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't have a table/from. You've got:

    SELECT fields WHERE...


  3. #3
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How the HELL did I do that?

    Seriously, someone inform me what I was thinking when I wrote that query.

    *goes to doctor to get head checked*

    -Sam
    Sam Hastings

  4. #4
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah nice going


Bookmarks

Posting Permissions

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