-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
This is an enhancement request to implement conditional bindings.
This feature would consider the parameter value; if found to be null, would throw the binding away, if not, would attach the defined arbitrary SQL to the relevant portion of the SQL.
A suggested solution to this may be as follows:
<?php
$arr_records = $obj_db->prepare("SELECT * FROM myTable WHERE col1= ?col1 AND col2 = ?col2 ?_cond_col3 order by xxx")
->bindIntIfNotNull('cond_col3', "AND col3 = ?", $col3)
->bindInt('col1', $col1)
->bindInt('col2', $col2)
->fetchAll();Reactions are currently unavailable