Now because the turnout is too many, the website often appears too many connection error, how to solve
Increase the maximum number of MySQL connections: MySQL The default number of connections is 100, this is a lot of concurrent connection to the database application is not enough, so we can modify it, edit My.ini max_connections=1000
Since the database is invoked with a MySQL statement, a temporary variable ($conn) is used to open the database each time the statement is executed, so when you use the MySQL statement, you remember to close the MySQL temp variable after each call to MySQL.
or without a database, write the data directly to a file. For very large access, it is not recommended to use a database, you can write the data you want to write to several created files, and then import the database together.
See a MySQL face question