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)