Come and check it out. it's weird! -Php Tutorial

Source: Internet
Author: User
Let's take a look at all the experts? It's strange to help !! It's strange. I can only insert 500 pieces of data into mysql, but not at all? & Nbsp; SOURCE ++ ++ & nbsp; for ($ i2; $ I & lt; $ data-& gt; sheets [0] [num experts all come and have a look? It's strange to help !!
It's strange. I can only insert 500 pieces of data into mysql, but not at all?
Source


++ ++

For ($ I = 2; $ I <= $ data-> sheets [0] ['numrows ']; $ I ++ ){

// Print the excel table data in a for loop with the following comments


/*

For ($ j = 1; $ j <= $ data-> sheets [0] ['numcols']; $ j ++ ){

Echo "\" ". $ data-> sheets [0] ['cells '] [$ I] [$ j]." \ ",";

}

Echo "\ n ";

*/

// The following code inserts [3 fields] of the excel table data into mysql. rewrite the following code based on the number of fields in your excel table!


$ SQL = "INSERT INTO uc_members (username, Phone, Address, cattype) VALUES (".
$ Data-> sheets [0] ['cells '] [$ I] [4]. ",'".
$ Data-> sheets [0] ['cells '] [$ I] [4]. "', '".
$ Data-> sheets [0] ['cells '] [$ I] [2]. "', '".
$ Data-> sheets [0] ['cells '] [$ I] [3]. "')". ';

If ($ data-> sheets [0] ['cells '] [$ I] [4] = $ data-> sheets [0] ['cells'] [$ I + 1] [4]) {
Echo 'Duplicate data found in your data! ';
} Else {
Mysql_query ($ SQL );
}
}



Supplement: I have tried all the settings. when the page is running, the database has a headache? No?


------ Solution --------------------
Timeout?
------ Solution --------------------
$ SQL and return values when the query is printed

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.