OK, I'm writing a script to generate a search with quite a few filtering options. Here is my function.
But $where never gets returned as true so I end up getting all WHEREs and no ANDs in the SQL command. Is there a special way to pass by reference in PHP?
PHP:
function addoperator($where) {
if($where == true) {
return " AND";
} else {
$where = true;
return " WHERE"; }
}
But $where never gets returned as true so I end up getting all WHEREs and no ANDs in the SQL command. Is there a special way to pass by reference in PHP?
Last edited: