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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.