Last active
August 29, 2015 14:12
-
-
Save zerowebcorp/d2627ca157fc5d4fc736 to your computer and use it in GitHub Desktop.
Find In Set
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 | |
$db->find_in_set('503', 'orders')->from('tblinvoices')->fetch(); | |
// Produces: SELECT * FROM tblinvoices WHERE FIND_IN_SET ('305', orders) | |
$db->where('id', 5)->find_in_set('503', 'orders')->from('tblinvoices')->fetch(); | |
// Produces: SELECT * FROM tblinvoices WHERE id='5' AND FIND_IN_SET ('305', orders) | |
$db->where('id', 5)->find_in_set('503', 'orders', 'OR')->from('tblinvoices')->fetch(); | |
// Produces: SELECT * FROM tblinvoices WHERE id='5' OR FIND_IN_SET ('305', orders) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment