SQL SELECT IN HOOK
Posted: 2016-12-14 11:00
i am still new at appgini and i have encountered this situation. I have the following code trying to retrieve Patient details;
$res = sql("SELECT Name,Address,Email,Patient_Phone FROM Patient WHERE ID=".$data['Patient_ID'],$eo);
if(mysql_num_rows($res)){
while($row = mysql_fetch_row($res)){
$data['Patient_Name'] = $row[0];
$data['Patient_Address'] = $row[1];
$data['Patient_Email'] = $row[2];
$data['Patient_Phone'] = $row[3];
}
}
This code is not running beyond the if statement meaning the $res object is does not have anything. What should I do to make it work. My table definitely has data.
$res = sql("SELECT Name,Address,Email,Patient_Phone FROM Patient WHERE ID=".$data['Patient_ID'],$eo);
if(mysql_num_rows($res)){
while($row = mysql_fetch_row($res)){
$data['Patient_Name'] = $row[0];
$data['Patient_Address'] = $row[1];
$data['Patient_Email'] = $row[2];
$data['Patient_Phone'] = $row[3];
}
}
This code is not running beyond the if statement meaning the $res object is does not have anything. What should I do to make it work. My table definitely has data.