Mysql OUTFILE命令不能与Joomla JPATH_SITE一起使用

时间:2013-09-20 16:29:12

标签: php mysql joomla into-outfile

我在Joomla&amp ;;中使用MySql OUTFILE命令命令不能使用Joomla路径常量,如JPATH_SITE,JPATH_ROOT或JURI :: root()。

命令正在使用正确的路径执行以下查询:

$filename = 'c:/Temp/users.csv';
$query = 'SELECT * INTO OUTFILE "'.$filename.'" 
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY \'"\'
    ESCAPED BY "\\\"
    LINES TERMINATED BY "\n"
    FROM jos_users'; 

以下是我在Joomla中使用的查询,该查询无效:

$filename = JPATH_SITE.DS.'users.csv';
$query = 'SELECT * INTO OUTFILE "'.$filename.'" 
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY \'"\'
    ESCAPED BY "\\\"
    LINES TERMINATED BY "\n"
    FROM jos_users';

请帮帮我。 感谢。

0 个答案:

没有答案