只適用單列查詢XD
所以我的作法是先匯入所有table的結構
在匯出data成insert語法成檔案~~~~~在執行程式匯入
---------------------------------------------------------------------------------------------------------------------
function db_connect(){
$link = mysqli_connect('localhost','root','12345678','dbname');
mysqli_query($link, "SET CHARACTER SET utf8");
return $link;
}
function db_query($sql){
return mysqli_query($GLOBALS['link'], $sql);
}
$GLOBALS['link'] = db_connect();
$handle = fopen("database.sql", "r");
while(!feof($handle))
{
db_query(fgets($handle));
}
fclose($handle);
沒有留言:
發佈留言