Created
February 28, 2014 16:25
-
-
Save bkmorse/9274056 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $search['cat_id'] = array(11, 12, 14); | |
| $sql .= ' AND (' . implode(' OR c.cat_id = ', $search['cat_id']) . ')'; | |
| echo $sql; | |
| // ( OR c.cat_id = 11 OR c.cat_id = 12 OR c.cat_id = 14) | |
| // I don't want it to incude the first OR, so I want the final result to be: (c.cat_id = 11 OR c.cat_id = 12 OR c.cat_id = 14) | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment