我有一个使用系统函数导出数据库的脚本。
$command = "c:\\xampp\\mysql\\bin\\mysqldump --opt -uuser -ppassword- --databases movies --result-file=export.php";
system($command);
我需要知道导入数据库的等效内容。
我正在使用 xampp 和 windows 8
最佳答案
我使用类似的东西,带有 mysqli 对象
$sql = file_get_contents('location/of/import.sql');
if($conn->multi_query($sql)){
while($conn->more_results() and $conn->next_result()){
;
}
};
关于php - 我需要使用系统php函数导入数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28959804/