What if we want to insert multiple lines of records? You might want to run the INSERT statement multiple times, just like the following PHP code example:
INSERT into Tbl_name (col1,col2) VALUES (.);
What if we want to insert multiple lines of records? You might want to run the INSERT statement multiple times, just like the following. NET code example:
New StringBuilder (); Strsql.append ("INSERT into Tbl_name (col1,col2) VALUES (15,16); " ); Strsql.append ("INSERT into Tbl_name (col1,col2) VALUES (15,16); " );......
Oh, so the code efficiency is very low, it will seriously occupy the computer resources, if it is the while (5,000 = = $a), it is necessary to execute the database query, WOW plug! Boy! If you use PHP to build a website and use a shared web hosting, you can expect that your site will soon be dead. This is a crime, then how to write to improve efficiency? I don't know if you've ever used MySQL's visual management tools phpMyAdmin or other database management software, when backing up a database, a. sql file is generated, which is a bunch of SQL statements, which you can look at with the INSERT statement:
INSERT into ' usertable ' (' user_id ', ' user_name ') VALUES (1'dsf'), ( 2'fgy'), (3'faad' );