Thread: Where clause
View Single Post
  #2  
Old 04-16-2012, 12:34 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 619,295
Hall of Famer is on a distinguished road
Default

Its quite easy, do this:

PHP Code:
$stmt $adopts->join("adoptables_conditions""adoptables_conditions.id = adoptables.id")                    ->select("adoptables", array(), "whenisavail = 'shop'"); 
The select() method accepts three arguments: table, columns and whereclause. The table is quite obvious, while columns need to be an array of what columns you want to fetch(pass an empty array to fetch all columns). The whereclause is whatever is after the WHERE keyword in an sql statement.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote