代碼點火器,你可以鍵入:如何返回當前對象?
$query = $this->db->query("YOUR QUERY");
foreach ($query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->body;
}
我猜測,查詢方法返回它的一部分的對象。我對麼?
如果我是,你怎麼輸入它返回對象的那一行?
所以我想知道它是如何看起來像在上面的代碼的功能的查詢方法。
public function query($sql) {
// some db logic here with the $sql and saves the values to the properties (title, name and body)
return X
}
換句話說,X應該是什麼?