dennismonsewicz Posted March 10, 2010 Share Posted March 10, 2010 I am trying to use the mysql command LOAD DATA INFILE and then spit out the results from the DB and I get nothing. No errors or anything. <?php mysql_connect('localhost', 'username', 'password')or die(mysql_error()); mysql_select_db('db_name')or die(mysql_error()); $insert = mysql_query("LOAD DATA LOCAL INFILE 'myfile.csv' INTO TABLE mytbl FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (`make`, `model`, `deductible`, `published`)") or die(mysql_error()); if($insert) { $query = mysql_query("SELECT * FROM mytbl"); while($row = mysql_fetch_object($query)) { $results .= $row; } echo '<pre>'; print_r($results); echo '</pre>'; } else { echo 'NOPE!'; } ?> Link to comment https://forums.phpfreaks.com/topic/194814-load-data-infile-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.