Why is my database backup script not working in php?

前端 未结 4 1600
北海茫月
北海茫月 2020-12-06 03:05

I am using the Database Backup script by David Walsh(http://davidwalsh.name/backup-mysql-database-php) to backup my MYSQL database as a .sql file to my server.

I cre

4条回答
  •  半阙折子戏
    2020-12-06 04:02

    You have to make sure that mysql_query does not first return a non-stream. Try this:

    ....
    
    if (false !== ($result = mysql_query('SHOW TALBES')) {
        while($row = mysql_fetch_row($result))
        {
            $tables[] = $row[0];
        }
    } else {
        // see Mchl's point about mysql_error
    }
    

提交回复
热议问题