cmor Posted July 26, 2007 Share Posted July 26, 2007 When I run this snippet: 77 78 @ $db = new mysqli('localhost', 'username', 'password', 'mydatabase'); 80 81 if (mysqli_connect_errno()) 82 { 83 echo 'Error: Could not connect to database. Please try again later.'; 84 exit; 85 } 86 87 LOAD DATA INFILE 'sqlsnow.txt' INTO TABLE weather; 87 $db->close(); I get: Parse error: syntax error, unexpected T_STRING in /home/cmor/public_html/sqlfile.php on line 87 Could anyone point me in the right direction? Thanks, -Chris Link to comment https://forums.phpfreaks.com/topic/61790-load_data_infile-t_string-error/ Share on other sites More sharing options...
btherl Posted July 26, 2007 Share Posted July 26, 2007 Try this: $db->query('LOAD DATA INFILE \'sqlsnow.txt\' INTO TABLE weather;'); Mysql commands are not "native" to php, instead they are treated as strings. Link to comment https://forums.phpfreaks.com/topic/61790-load_data_infile-t_string-error/#findComment-307687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.