0

I have a select query on table and the result is more then 15000 lines, when i execute it with pdo, it didn't return any result

Is there any solution to return the result with my script.

NB : in phpMyAdmin, the query return the desired result

$dbh = new PDO('mysql:host=localhost;dbname="namedb";charset=utf8', 'root', '');
$sth = $dbh->prepare("select * from table");
$sth->execute();
var_dump($data = $sth->fetchAll());
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • 2
    maybe you are not connected or a 100 other reasons – Drew Sep 05 '16 at 14:59
  • You should post your real code (apart from your password...) as `table` is not going to work in phpMyAdmin either. And add error handling; have PDO throw exceptions for example. – jeroen Sep 05 '16 at 15:02
  • 15,000 rows! Maybe you have blown the memory limit, or the execution time limit. All these and many other possibilities can be checked by ___Looking at your error log___ or using `error_reporting(E_ALL); ini_set('display_errors', 1);` at the top of each script you are debugging – RiggsFolly Sep 05 '16 at 15:05
  • Or dare I say it, checking the status's of each line of PDO code. They all return one, or setting PDO to throw exceptions – RiggsFolly Sep 05 '16 at 15:06

0 Answers0