我想在Mysql中创建表使用Random()函数我尝试但不能创建。 [英] I Want To Create Table In Mysql With Use Of Random() Function I Try But Cant Create.

查看:121
本文介绍了我想在Mysql中创建表使用Random()函数我尝试但不能创建。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php
$con = mysql_connect("localhost","root","");
   		mysql_select_db("textile");
		if (!$con)
		{
			die('Could not connect: ' . mysql_error());
		}

$temp_table=rand(1000,9999);
$sql="CREATE TABLE $temp_table(FirstName CHAR(30),LastName CHAR(30),Age INT)";

// Execute query
if (mysql_query($con,$con))
  {
  echo "Table persons created successfully";
  }
else
  {
  echo "Error creating table: " . mysqli_error($con);
  }

?>





但未创建请帮助..



but not created please help..

推荐答案

con = mysql_connect( localhost root,< span class =code-string> );
mysql_select_db( textile);
if (!
con = mysql_connect("localhost","root",""); mysql_select_db("textile"); if (!


con)
{
die(' 无法连接:' .mysql_error());
}
con) { die('Could not connect: ' . mysql_error()); }


temp_table = rand(1000,9999);
temp_table=rand(1000,9999);


这篇关于我想在Mysql中创建表使用Random()函数我尝试但不能创建。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆