The problem comes when I go to execute the statement. It's difficult for me to determine which arguments to pass to execute() (the variables for the placeholders in the SQL statement). Is there a philosophy, recommended approach, or module that can help with this? Otherwise, I end up with large if statements calling variations of execute()if ($time) { $sql .= 'AND time = ? '; } if ($date) { $sql .= 'AND date = ? '; }
In reply to Managing Dynamic SQL by mhearse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |