tweakui Posted October 11, 2010 Share Posted October 11, 2010 Hello, This is query in MySQL mysql> LOAD DATA LOCAL INFILE '/var/www/html/numbers.csv' INTO TABLE details FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (number);Query OK, 0 rows affected (0.00 sec) Records: 2200 Deleted: 0 Skipped: 1200 Warnings: 0 Now, I am trying to run the same query in PHP and display the same results.... (i.e. Records, Deleted, Skipped) <?php$db=mysql_connect("localhost", "user", "1234") or die(mysql_error()); $dname="database"; mysql_select_db($dname)or die(mysql_error()); $sqlstatement="LOAD DATA LOCAL INFILE '/var/www/html/numbers.csv' INTO TABLE details FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (number)" ; mysql_query($sqlstatement) or die(mysql_error());; echo "it is done!"; ?> Tried mysql_fetch_array, row but could not get it to work... please help guys Link to comment https://forums.phpfreaks.com/topic/215629-mysql-query-results-to-php/ Share on other sites More sharing options...
ialsoagree Posted October 11, 2010 Share Posted October 11, 2010 See mysql_info(): http://www.php.net/manual/en/function.mysql-info.php Link to comment https://forums.phpfreaks.com/topic/215629-mysql-query-results-to-php/#findComment-1121164 Share on other sites More sharing options...
tweakui Posted October 11, 2010 Author Share Posted October 11, 2010 Hey thanks , mysql_info():, served the purpose... Best Regards Link to comment https://forums.phpfreaks.com/topic/215629-mysql-query-results-to-php/#findComment-1121230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.