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.
SQL SELECT IN HOOK
Re: SQL SELECT IN HOOK
I'm not sure but I think appgini changes
and
to
instead of
shouldn't it be
Worth a shot though
Thanks,
Joe
Code: Select all
mysql_num_rows
Code: Select all
mysql_fetch_row
Code: Select all
if(db_num_rows($res)){
while($row = db_fetch_row($res)){
Code: Select all
mysql_fetch_row
Code: Select all
db_fetch_assoc
Thanks,
Joe