0

I just run this command and I resulted in having many null rows:

$query = "LOAD DATA LOCAL INFILE '$file_destination'  
          INTO TABLE tbl_data";
          $result = mysql_query($query);
// File destination is the place of the uploaded file

Any help?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
GaGa
  • 1
  • 1
  • 3
    Please, [stop using `mysql_*` functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php). They are no longer maintained and are [officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). Learn about [prepared statements](http://en.wikipedia.org/wiki/Prepared_statement) instead, and consider using PDO, [it's not as hard as you think](http://jayblanchard.net/demystifying_php_pdo.html). *Check the file for null rows.* – Jay Blanchard May 11 '15 at 15:46
  • Assuming that your tbl_data has a primary key defined, use the IGNORE option for LOAD DATA LOCAL INFILE – Mark Baker May 11 '15 at 15:48
  • Yes primary key is defined! and trying the suggestions ..... – GaGa May 11 '15 at 16:27

0 Answers0