I'm running a query to a MySQL instance from php, it worked in a different file before and when I copied it over it always seem to return empty.
function getDelivery($eid, $raid){
ChromePhp::log("eid:".$eid." raid:".$raid);
$mysqli = getMysqliConnection();
$q = "SELECT COMMENTS, DELIVERY_TIME FROM DELIVERY WHERE RAID = ? AND EID = ?;";
$stmt = $mysqli->prepare($q);
$stmt->bind_param('ss'. $raid, $eid);
$stmt->bind_result($comments, $time);
$stmt->execute();
if($stmt->fetch()){
ChromePhp::log("TIME: ". $time);
$data = array("comments" => $comments, "time" => $time ,"raid" =>$raid, "eid"=>$eid);
echo json_encode($data);
}else{
echo "{}";
}
$stmt->close();
$mysqli->close();
}
I used the chrome console to make sure eid and raid is not NULL, when I copied the query over to phpAdmin returned 1 result. but the fetch() seem to always return false, is there anything wrong with it that it always return nothing?