how do you specify 2 where criteria when selecting from mySQL?
Cheers,
Simon
Multiple where
Moderator: General Moderators
Multiple where
Last edited by thesimon on Thu Mar 17, 2005 12:02 am, edited 3 times in total.
this is how i usually end up adding a where clause to a query...
Code: Select all
// $this->_where : property
// $where : optional parameter
// $q1: the complete query
if (!empty($this->_where))
{
if (!empty($where))
{
$where = "($where) AND ($this->_where)";
}
else
{
$where = $this->_where;
}
}
if (!empty($where))
{
$q1 .= " WHERE $where";
}