Menu
I would like to be able to store some search paramaters in an array so that a user can search on certain fields in a database. The way I saw this happening in my mind was along the lines as follows
[code=php]
$selectParams[0] = “status=’open'”;
$selectParams[0] = “user=’$currentUser'”;
$sql = ‘SELECT * FROM hd_incident WHERE ‘;
$sql .= foreach($selectParams[] as $param){
echo $param;
}
The problem with this is, how would I get the AND statement into the equation? Also, the above is just an example. The real query would probably be longer with between 0 and 7 parameters (Maybe more).