what's wrong?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Man-wai Chang

    what's wrong?


    insert into canton ( big5, thekey, changjei, canton, touched ) values ('
    µ\\','BAY ','MGPP ','PEI ',0)

    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 'BAY
    ','MGPP

    'µ\\' is mysql_real_esca pe_string('µ\')

    --
    iTech Consulting Co., Ltd.
    Expert of ePOS solutions
    Website: http://www.itech.com.hk (IE only)
    Tel: (852)2325 3883 Fax: (852)2325 8288
  • Heiko Richler

    #2
    Re: what's wrong?

    Man-wai Chang wrote:
    insert into canton ( big5, thekey, changjei, canton, touched ) values ('
    µ\\','BAY ','MGPP ','PEI ',0)
    >
    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 'BAY
    ','MGPP
    >
    'µ\\' is mysql_real_esca pe_string('µ\')
    'µ\\' is strange! Did you try replacing it by anything else? \' May not
    be seen as the end of the string. There would be a string " µ\',"
    followed by BAY...

    FUp2: comp.databases. mysql

    Heiko
    --
    http://portal.richler.de/ Namensportal zu Richler
    http://www.richler.de/ Heiko Richler: Computer - Know How!
    http://www.richler.info/ private Homepage

    Comment

    • peter

      #3
      Re: what's wrong?

      insert into canton ( big5, thekey, changjei, canton, touched ) values ('
      µ\\','BAY ','MGPP ','PEI ',0)
      >
      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 'BAY
      ','MGPP
      >
      'µ\\' is mysql_real_esca pe_string('µ\')
      The sql is failling because you have opened the quotes and not closed them
      before the bay input (you have used an escape character before the closing
      quote.


      Comment

      • Jerry Stuckle

        #4
        Re: what's wrong?

        peter wrote:
        >insert into canton ( big5, thekey, changjei, canton, touched ) values ('
        >µ\\','BAY ','MGPP ','PEI ',0)
        >>
        >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 'BAY
        >','MGPP
        >>
        >'µ\\' is mysql_real_esca pe_string('µ\')
        >
        The sql is failling because you have opened the quotes and not closed them
        before the bay input (you have used an escape character before the closing
        quote.
        >
        >
        That would give a PHP syntax error. He's getting a MySQL error.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • Jerry Stuckle

          #5
          Re: what's wrong?

          Man-wai Chang wrote:
          insert into canton ( big5, thekey, changjei, canton, touched ) values ('
          µ\\','BAY ','MGPP ','PEI ',0)
          >
          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 'BAY
          ','MGPP
          >
          'µ\\' is mysql_real_esca pe_string('µ\')
          >
          Interesting. What is your table definition and what charset are you
          using? Also, what is the hex value of 'µ\'?

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          • peter

            #6
            Re: what's wrong?

            That would give a PHP syntax error. He's getting a MySQL error.
            If for example in the php code he has the following:-

            $sql = "insert into canton ( big5, thekey, changjei, canton, touched )
            values ('\','BAY ','MGPP ','PEI ',0)"

            then no it will not create a php parse error it will have an sql error like
            he has as \' is an escaped single quotation mark thus the closing quotation
            mark is the 1 directly before BAY


            Comment

            • Jerry Stuckle

              #7
              Re: what's wrong?

              peter wrote:
              >That would give a PHP syntax error. He's getting a MySQL error.
              >
              If for example in the php code he has the following:-
              >
              $sql = "insert into canton ( big5, thekey, changjei, canton, touched )
              values ('\','BAY ','MGPP ','PEI ',0)"
              >
              then no it will not create a php parse error it will have an sql error like
              he has as \' is an escaped single quotation mark thus the closing quotation
              mark is the 1 directly before BAY
              >
              >
              That's true if the entire string is includes in double quotes. But that
              isn't at all clear in the original statement. But you're probably right.

              One fact remains - mysql_real_esca pe_string should be taking care of this.


              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              Working...