开发者

Exporting MYSQL Table to file using PHP

I got this code on this website, but I can't get it working.

$file = 'backups/mytable.sql'; 
$result = mysql_query("SELECT开发者_高级运维 * INTO OUTFILE '".$file."' FROM ##TABLE##");

I then modified it:

$file = "Backups/mytable.sql"; 
$result = mysqli_query("SELECT * INTO OUTFILE '".$file."' FROM comments") or die ("Query Died: Exporting");

The query just dies, no PHP error. I am using XAMPP.


Do you have permission to do this?

The priviledge attribute is 'FILE' and it works both ways, reading from and writing to files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜