首页 > 代码库 > php建立MySQL数据表

php建立MySQL数据表

<?php

$connect mysql_connect("127.0.0.1","root","");

mysql_select_db("bjh160303");

if($connect){

echo "链接成功";

}else{

echo "链接失败";

}

 

$building = "create table json(id INT PRIMARY KEY,title TEXT NOT NULL,price TEXT NOT NULL,author TEXT NOT NULL,date TEXT NOT NULL)";

$go mysql_query($building);

 

mysql_close($connect);

?>

php建立MySQL数据表