【发布时间】:2011-08-04 05:30:54
【问题描述】:
我正在尝试恢复通过以下方式创建的 MySQL 转储:
require_once 'mysql_restore.class.php';
$restore_obj = new MySQL_Restore();
$restore_obj->server = 'localhost';
$restore_obj->username = 'root';
$restore_obj->password = '';
$restore_obj->database = 'database';
if (!$restore_obj->Execute(MSR_FILE, 'bk.sql.gz', true, false))
{
die($restore_obj->error);
}
但它显示一个错误
警告:gzuncompress() [function.gzuncompress]: 第 42 行 C:\wamp\www\nidhin\mysql_restore.class.php 中的数据错误 警告:在第 215 行的 C:\wamp\www\nidhin\mysql_restore.class.php 中为 foreach() 提供的参数无效
知道我做错了什么吗?
【问题讨论】:
-
我认为错误状态可能是传递给类的对象类型不匹配。除非我们瞥见了mysql_restore.class.php,否则我们可以找到错误。可以您发布了第 215 行的确切内容?
-
嗨 kvijayahari,它现在可以工作了,它的函数参数顺序错误