[SOLVED] to view a list using models

#1
[eluser]Unknown[/eluser]
Hello;
I got a program for library. and i had some models. one of them is "book". and it has "is_available" (boolean) field.
and i want to take a "available books list".
can you help me about this please?
if i want to view a specific book i do it like this:
$this->db->where("book_id", $this->input->post("book_id"));
$query = $this->db->get('book');

#2
[eluser]WebsiteDuck[/eluser]
Code:
$this->db->where("book_id", $this->input->post("book_id"));
$this->db->where("is_available", true);
$query = $this->db->get('book');

or if you want all available books get rid of the first line

#3
[eluser]Unknown[/eluser]
thnank you Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.