Welcome Guest, Not a member yet? Register   Sign In
num_rows not working in ODBC Multiple DB object
#2

One more problem
I found that if I just use $query->result(), I can get the result normally with both connection

but once I use $query->num_rows() in object $main_db
the $query will turn All Null

for example,
$query = $main_db->query($sql);
foreach ($query->result() as $row)
{
echo $row->a.",";
}
echo "<br/>";

$query = $main_db->query($sql);
echo $query->num_rows();
foreach ($query->result() as $row)
{
echo $row->a.",";
}


and result would be:
a,b,c,d,e,f,g,h,i,j,
0
^(this line supposed to run foreach too but nothing)
Reply


Messages In This Thread
RE: num_rows not working in ODBC Multiple DB object - by judaskit - 02-25-2016, 11:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB