使用php导出数据库时出现严格的标准错误

时间:2013-11-15 06:01:11

标签: php mysql database export syntax-error

这是我的PHP代码
    

//DONT EDIT BELOW THIS LINE
//Export the database and output the status to the page
$command='mysqldump --opt -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' > ~/' .$mysqlExportPath;
exec($command,$output=array(),$worked);
switch($worked){
case 0:
    echo 'Database <b>' .$mysqlDatabaseName .'</b> successfully exported to <b>~/' .$mysqlExportPath .'</b>';
    break;
case 1:
    echo 'There was a warning during the export of <b>' .$mysqlDatabaseName .'</b> to <b>~/' .$mysqlExportPath .'</b>';
    break;
case 2:
    echo 'There was an error during export. Please check your values:<br/><br/><table><tr><td>MySQL Database Name:</td><td><b>' .$mysqlDatabaseName .'</b></td></tr><tr><td>MySQL User Name:</td><td><b>' .$mysqlUserName .'</b></td></tr><tr><td>MySQL Password:</td><td><b>NOTSHOWN</b></td></tr><tr><td>MySQL Host Name:</td><td><b>' .$mysqlHostName .'</b></td></tr></table>';
    break;
}
?>

当我尝试执行此文件时。显示此错误。 “严格的标准:在第12行的C:\ wamp \ www \ dbest.php中只能通过引用传递变量”

为什么会出现此错误?拜托我...谢谢

1 个答案:

答案 0 :(得分:1)

  

赋值表达式的值是指定的值

Assignment Operators

$output=array()是返回值(空数组)但不是变量的表达式。所以它不能用作通过引用得到这个论点的fuctnions的参数。

但您可以尝试使用this bug