[eluser]massi84[/eluser]
Hey, I'm trying to get values from 2 different tables.
Problem here is that I'm getting Fatal error: Call to undefined method CI_DB_mysqli_driver::num_rows() at line :if ($data->num_rows()>0) ...
If someone could point out me to right direction, i would appreciate it.
this is in model:
Code:
function test()
{
$short = $this->_altdb->get('table1');
if ($short->num_rows()>0)
{
$i=0;
foreach ($short->result() as $row)
{
$shorten = $row->column1;
$data = $this->_altdb->like('column', $shorten);
if ($data->num_rows()>0)
{
foreach ($data->result() as $row)
{
$name=$row->column2; // column 2 from table2
// here need to put values at same variable $all_data
$all_data[$i]['column1'] = $shorten;
$all_data[$i]['column2'] = $name;
}
}
$i++;
}
}
}
Might add that database configurations are correctly entered so basicly problem is in this function.
Hopefully its easy to read, thanks
Massi