通過PHP連接MYSQL數據庫
$conn = mysql_connect("localhost","root","password") or die("無法連接數據庫");
mysql_select_db("table" ,$conn) or die ("找不到數據源");
通過PHP創建MYSQL數據庫
$conn = mysql_connect("localhost","root","password") or die("無法連接數據庫");
mysql_create_db("webjx") or die("無法創建數據庫");
$sqlstr = "create database other_webjx";
mysql_query($sqlstr) or die("無法創建,一般請檢查權限什麼的");
創建mysql的表
$conn = mysql_connect("localhost","root","password") or die("無法連接數據庫");
mysql_select_db("webjx",$conn) or die("無法連接數據庫webjx");
$sql = "create table webjx_table(
ids integer not null auto_increment ,
primary key(ids)
)";
$mysql_query($sql) or die(mysql_error());