Why does the INSERT into MYSQL database fail?

Source: Internet
Author: User
Keywords House 13044064 dateline 20130227 insert
When I use

Reply content:

Output mysql_error (); look.
It seems that PHP cannot execute multiple SQL statements at once for system security.
You replace
$sql="INSERT INTO MSG_TEST(HOUSE_ID,HOUSE_TYPE,PV,UV,CITY_ID,DATELINE) VALUES(13044064,5,6,5,2600,20130227),(1425578,8,6,5,2500,20130227),(18705325,1,3,3,801,20130227)";看看
Manual.
mysql_query
(PHP 4, PHP 5)
mysql_query-Send a MySQL query
Description
Resource mysql_query (String $query [, Resource $link _identifier])
mysql_query () sends a query to the currently active database in the server associated with the specified connection identifier. If link_identifieris not specified, the previous open connection is used. If there is no open connection, this function attempts to call the mysql_connect () function without arguments to establish a connection and use it. The query results are cached.
Note:
The query string should not end with a semicolon.

Multiple statements are not supported for querying together. Are you sure you wrote the right insert? Go back and turn the manual.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.