在php教程中創建 數據表代碼
$link=mysql教程_connect("localhost","root","3435945")or die("***".mysql_error());
echo "成功接連到服務器";
if(mysql_select_db(base2,$link)) echo"選擇到base2數據庫教程";
$sql="create table t1(id int(5) not null primary key,name varchar(12) not null)";
if(mysql_query($sql,$link))
echo "表T1創建成功";
echo "<p>";
echo "當前base2數據庫上的表有:";
echo "<p>";
$table_list=mysql_query("show tables",$link);
while($row=mysql_fetch_row($table_list)){
echo $row[0];
echo "<p>";
}