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

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

WBOY
WBOYOriginal
2016-06-13 10:31:42889browse

写一个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);
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn