MySQL the right syntax to use near '' at line 1 error

后端 未结 2 1386
忘掉有多难
忘掉有多难 2020-12-10 13:19

hello i have a run a query using php it give error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for

2条回答
  •  醉话见心
    2020-12-10 13:44

    the problem is because you have got the query over multiple lines using the " " that PHP is actually sending all the white spaces in to MySQL which is causing it to error out.

    Either put it on one line or append on each line :o)

    Sqlyog must be trimming white spaces on each line which explains why its working.

    Example:

    $qr2="INSERT INTO wp_bp_activity
          (
                user_id,
     (this stuff)component,
         (is)      `type`,
        (a)        `action`,
      (problem)  content,
                 primary_link,
                 item_id,....
    

提交回复
热议问题