这是根据日期每天创建表格的代码。但是没有在数据库中创建新表。请帮帮我。代码如下:
$date = date ('Ymd');
echo $date;
$query = "CREATE TABLE TEST_" . $date;
$query .= " (Name text(20), Class int(5), Age int(3), Date date, created CURRENT_TIMESTAMP);";
答案 0 :(得分:0)
如果没有Concat,您可以直接传递
$date = date ('Ymd');
$query = "CREATE TABLE tbltable_'".$date."' (
Name varchar (50) NOT NULL,
Class int,
Age int,
Date date,
created CURRENT_TIMESTAMP
)";
mysqli_query($query) or die(mysqli_error());