I'm trying to get data fom a database, the problem is that I get a notice 'Array to string conversion', and $array returns 'Array'. the get_rows method gets all the rows using the current query. Any idea why this is happening? here's the code:
public function load_seat_by_number($seat_number)
{
$db = model_database::instance();
$sql = "SELECT * FROM `seats` WHERE `seat_number` = '". intval($this->seat_number). "'";
if (($array = $db->get_rows($sql)) > 0)
return $array;
else return FALSE;
}
intval($this->seat_number)should just beintval($seat_number), no?