gpt4 book ai didi

php - 语法错误,PHP 中的意外 T_CONSTANT_ENCAPSED_STRING

转载 作者:行者123 更新时间:2023-12-01 00:15:56 27 4
gpt4 key购买 nike

<分区>

mysql_connect("localhost","root","");
mysql_select_db("hitnrunf_db");

$result=mysql_query("select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '""' TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n' ");

header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=your_desired_name.xls");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n$data";

在上面的代码中查询字符串,即 mysql_quey 中的字符串

出现以下错误

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\samples\mysql_excel\exel_outfile.php on line 8

在查询字符串中 '\n' charter 没有被识别为字符串,这就是为什么出现上面的错误

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com