Write a php file, automatically create a MYSQL table cyclically, write a php file at 20 minutes, and automatically create a MYSQL table at intervals of 20 minutes. The table name is defined as table20100531 and table20100601, table20100602 ............................ the table20101231 field is: how to write a php file for a table created in nametextdate1int11 for one year, and automatically create a MYSQL table cyclically.
Write a php file and create a MYSQL table cyclically.
Table name definition: table20100531, table20100601, table20100602. ............ table20101231
Field: name text date1 int 11
How can I write a cycle for a table created for one year?
------ Solution --------------------
$ T = date ('Y'). '123 ';
For ($ I = 0; I I <366; $ I ++ ){
$ Tabname = 'table'. date ('ymd', strtotime ($ t) + $ I * 86400 );
$ SQL = 'create table $ tabname .....';
Mysql_query ($ SQL );
}