php - Fetch returning null, but rowCount giving the correct number of rows -


so have little pdo code right here:

$list=array(); $stmt = $pdo->prepare("select * cal_project join cal_customer on cal_project.cust_id = cal_customer.cust_id" . $limit); $stmt->execute(); while ($row = $stmt->fetch(pdo::fetch_assoc)) {         $list[] = $row; } return $list 

which returns empty when echo app. now, have little snipbit:

$num_returns = $stmt->rowcount(); 

which returns proper number of rows every time. ideas cause of issue? know sql works on own, both row count , testing in phpmyadmin

edit: response calls list keys, function code above held in:

$response['list'] = listkeys($request,$object->techid, $limit); echo json_encode($response); 

as stated in comment, code works fine in php 5.4, not in 5.5 , above

edit 2: added in declaration $list subvert confusion , returned $list because forgot paste in


Comments