SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: syntax error?

  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,642
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    syntax error?

    I get this error when this code is run

    PHP Code:
    $sql "UPDATE PROVIDER SET 
    Approve = '1',
    IP_Address = '
    $IP',
    Name = '
    $Name',
    Email = '
    $Email',
    Website = '
    $Website',
    Phone = '
    $Phone',
    Display_Email = '
    $Display_Email',
    Website_URL = '
    $Website_URL',
    Display_Phone = '
    $Display_Phone',
    Age ='
    $Age',
    Eye = '
    $Eye',
    Rate = '
    $Hourly_Rate',
    Location = '
    $Location',
    Other_Location = '
    $Other_Location',
    Hair_Color = '
    $Hair_Color',
    Build = '
    $Build',
    Hair_Length = '
    $Hair_Length',
    Bust = '
    $Bust',
    Hips = '
    $Hips',
    Cup = '
    $Cup',
    Waist = '
    $Waist',
    Height = '
    $Height',
    Availability = '
    $Availability',
    Grooming = '
    $Grooming',
    Services = '
    $Services_Offered',
    Rules = '
    $Rules',
    Who = '
    $Who',
    From = '
    $From',
    To = '
    $To'
    WHERE ID = '
    $ID'";
    echo 
    $sql
    And heres the output
    UPDATE PROVIDER SET Approve = '1', IP_Address = '24.161.187.25', Name = 'llllllllllllllllllll', Email = 'test@aol.com', Website = 'No', Phone = '', Display_Email = 'No', Website_URL = '', Display_Phone = '', Age ='', Eye = '', Rate = '', Location = 'Las Vegas, NV', Other_Location = '', Hair_Color = '', Build = '', Hair_Length = '', Bust = '', Hips = '', Cup = 'N/A', Waist = '', Height = '', Availability = 'In-call', Grooming = 'Clean Shaven', Services = 'N/A', Rules = '', Who = '<br>', From = '2007-09-12', To = '2007-09-12' WHERE ID = '98'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 'From = '2007-09-12', To = '2007-09-12' WHERE ID = '98'' at line 29
    Where is the syntax error?
    Thanks
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,247
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    where is the error occurring?

    answer: near 'From = '2007-09-12', ...


    FROM is a reserved word

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,642
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    OH, so ill change
    From to something like (From_Date?)
    Thanks
    "Oh, and Jenkins--apparently your mother died this morning."

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,247
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    yes
    you're welcome
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bookmark the forbidden word page.


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
  •