Professional Web Applications Themes

please help - mysterious extra characters appearing in SQL update - MySQL

This is a real strange problem. I have some asp code (javascript) that sends a simple update sql command to mysql 5. my sql is this UPDATE Users SET YouGotMail = -1 WHERE pas_User = 'Clive' and when it's sent to the database this is the error Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [MySQL][ODBC 3.51 Driver][mysqld-5.0.21-community-nt]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 '{ call Exectute('UPDATE Users SET YouGotMail = -1 WHERE pas_User = \'Clive\'') }' at line 1 ...

  1. #1

    Default please help - mysterious extra characters appearing in SQL update

    This is a real strange problem. I have some asp code (javascript) that
    sends a simple update sql command to mysql 5.

    my sql is this
    UPDATE Users SET YouGotMail = -1 WHERE pas_User = 'Clive'

    and when it's sent to the database this is the error

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [MySQL][ODBC 3.51 Driver][mysqld-5.0.21-community-nt]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 '{ call
    Exectute('UPDATE Users SET YouGotMail = -1 WHERE pas_User = \'Clive\'')
    }' at line 1

    Backslash characters have some how been inserted into the string. I
    know the sql is ok. Works fine in the MySQL Query Browser. I was
    wondering if it something to do with language settings but it's
    something i'm new too. However the table Users is set up by english
    defaults [latin1] and this kind of query is working fine with all my
    other tables.

    I've been googling for a solution for the last two weeks and i've come
    up with nothing. I'm just hoping that someone has had a similar problem
    before.

    Regards
    AndyB

    digger440uk Guest

  2. #2

    Default Re: please help - mysterious extra characters appearing in SQL update

    digger440uk wrote: 

    It sounds like your environment is trying to save you from SQL injection
    by automatically escaping the ' in your queries.

    Cheers,
    Nicholas Sherlock

    --
    http://www.sherlocksoftware.org
    Nicholas Guest

  3. #3

    Default Re: please help - mysterious extra characters appearing in SQL update

    On 24 Sep 2006 09:05:20 -0700, digger440uk wrote: 

    For the error message, the backslashes look correct, in the sense that
    you've got singlequotes inside a singlequoted string.
     

    You haven't posted real source code nor anything about how this is
    coming out, and I'd bet you any figure you care to name that this has
    got absolutly nothing to do with MySQL and everything to do with the asp
    code.

    --
    The pig is nothing but a giant dish which walks while waiting to be served.
    --Grimod de La Reynière
    Peter Guest

Similar Threads

  1. Funny characters appearing in my text!
    By Black People Online in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: July 1st, 12:46 PM
  2. Help - Extra Characters
    By ErinT in forum Macromedia ColdFusion
    Replies: 4
    Last Post: June 3rd, 05:18 PM
  3. Foreign Characters Keep Appearing in my PDF doent
    By Megan_Whelen@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 20th, 02:47 PM
  4. Odd characters appearing when exporting to PDF
    By andymbee webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 1
    Last Post: October 7th, 11:57 AM
  5. Mysterious numbers appearing...
    By wesley in forum FileMaker
    Replies: 5
    Last Post: August 4th, 09:10 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139