如何用PHP创建自动多表?

时间:2013-07-19 09:51:18

标签: php mysql

请在我的照片库项目中帮助我!我希望一次使用PHP自动创建多个表,并且每个表也将显示单独的登录人员的图像。 我正在使用此代码:

$database_connection = mysql_connect("localhost","gallery","phpOTL123") or die("not connected") .mysql_error();

$db = mysql_select_db("photo_gallery") or die("not selected") .mysql_error();


$first     = $_POST['uname'];
$email     = $_POST['eMail'];
$password  = $_POST['passwrd'];

mysql_query($database_connection, "CREATE TABLE new_user(username varchar(55), password varchar(40), email_id varchar(25))";

$sql = "INSERT INTO new_user(username, password, email_id) values ('$first', '$password', '$email')";

$query_finish = mysql_query($sql) or die("Not inserted").mysql_error();

if(isset($query_finish))
{
header('Location:index.php');
}
else 
{
 //Failed 
}

0 个答案:

没有答案