开发者

Exporting MYSQL Table to file using PHP

开发者 https://www.devze.com 2023-03-01 05:27 出处:网络
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 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

精彩评论

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