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 4 of 4
  1. #1
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts

    query syntax error?

    For this line of code:

    PHP Code:
    $queryW "UPDATE customer_dbase SET " $column "=" $update " WHERE index_no LIKE '%" $ref_no "%'";
    $resultW mysql_query($queryW);
    {
        die(
    "<br>" mysql_errno() . ": " mysql_error() . "<br>");

    I get the following SQL error:
    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 index_no LIKE '%3%'' at line 1
    anyone see the problem? thanks.
    Last edited by chump2877; 06-26-2005 at 01:01 PM.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Try using

    PHP Code:
    $queryW "UPDATE customer_dbase SET " $column "=" $update " WHERE index_no = '" $ref_no "';"

  • #3
    Regular Coder
    Join Date
    Jun 2005
    Posts
    804
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something's wrong with your $update variable -- it may not be set correctly, or if it's a string, it needs to have single quotes around it like $ref_no.

  • #4
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Something's wrong with your $update variable -- it may not be set correctly, or if it's a string, it needs to have single quotes around it like $ref_no.

    $update is a string, so you were exactly right about having single quotes around it....thanks!
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪


  •  

    Posting Permissions

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