Originally Posted by Dormilich
the single fields and checkboxes are quite straightforward. you have a key and a value in the $_POST/$_GET array.
$source = array_filter($_POST, /* filter function */);
$conditions = array();
foreach ($source as $field => $value)
// for queries
$conditions = $field . " = " . sql_escape($value);
// for (PDO) prepared statements
$conditions = $field . " = :" . $field;
$where = " WHERE " . implode(" AND ", $conditions);
Thanks for your help this far. With this sample code, do I need to make a new prepare and execute each time or just a single one at the end?