我想使用我找到的here的PHP脚本导出我的数据库。
当我运行PHP脚本时,会创建sql
,但sql
为空。
此外,它还在浏览器中显示此错误:
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\test\Export.php on line 12
There was a warning during the export of testing to ~/database/test1.sql
第12行是这一行:
exec($command,$output=array(),$worked);
此外,我改变了示例中的输出路径,
$mysqlExportPath ='database/test1.sql';
如何解决此错误?或者其他任何例子?
答案 0 :(得分:1)
问题是你在这一行中分配一个空白数组
exec($command,$output=array(),$worked);
所以只需在此命令中添加一个变量。
$output=array();
exec($command,$output,$worked);