![]() |
Variables of single row in view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Variables of single row in view (/showthread.php?tid=27722) |
Variables of single row in view - El Forum - 02-18-2010 [eluser]Fero[/eluser] Hi, This is my model function: Code: function nacitaj_produkt($id) It loads one row of one product and returns it. This is in one method of my controller: Code: $this->load->model('produkty_model'); in detail.php (view) I have no idea how to get those variables from database I got. echo $product->table_column; works only in loops in views, but it doens't work when there is only one row. Variables of single row in view - El Forum - 02-18-2010 [eluser]JoostV[/eluser] Model Code: function nacitaj_produkt($id) View Code: if($product != false) { Variables of single row in view - El Forum - 02-18-2010 [eluser]Fero[/eluser] Thx, actually, you pointed me to right direction with $query->row() and also to check if there was anything in the row at all :-) Variables of single row in view - El Forum - 02-19-2010 [eluser]JoostV[/eluser] You're welcome ![]() |