boon_chong Posted December 18, 2006 Share Posted December 18, 2006 when i run the code below, there is no text file come out, please help...[code]<meta http-equiv="refresh" content="5"> <?include("8_dbconnect.php");$sql = ("SELECT distinct itemNo,itemDesc,proGroup,saleType,oriPrice,disc,netPrice, qty,total,date,outlet INTO OUTFILE 'C:/123.txt' FIELDS TERMINATED BY '|' LINES TERMINATED BY '\\r\\n' FROM employee"); $mysql_result = mysql_query($query); include("8_dbdisconnect.php"); ?>[/code] Link to comment https://forums.phpfreaks.com/topic/31062-export-mysql-data-to-a-text-file/ Share on other sites More sharing options...
btherl Posted December 18, 2006 Share Posted December 18, 2006 First thing to do is check for errors. It would also help if you used $sql instead of $query in mysql_query() :)[code=php:0]$mysql_result = mysql_query($sql) or die("Error in $sql:" . mysql_error());[/code] Link to comment https://forums.phpfreaks.com/topic/31062-export-mysql-data-to-a-text-file/#findComment-143427 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.