Heim >Backend-Entwicklung >PHP-Tutorial >写一个PHP资料,自动循环创建MYSQL表,20分相送

写一个PHP资料,自动循环创建MYSQL表,20分相送

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 10:31:42905Durchsuche

写一个PHP文件,自动循环创建MYSQL表,20分相送
写一个PHP文件,自动循环创建MYSQL表,20分相送

表名定义:table20100531,table20100601,table20100602............................table20101231

字段为:name text date1 int 11

建1年的表 怎么写循环啊

------解决方案--------------------
$t = date('Y').'0101';
for($i=0;$i  $tabname = 'table' . date('Ymd',strtotime($t) + $i*86400);
 $sql = 'create table $tabname .....';
 mysql_query($sql);
}

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:windows上制作PHP扩展Nächster Artikel:Ubuntu中PhpMyAdmin装配说明