Welcome Guest, Not a member yet? Register   Sign In
Quotes in query
#2

[eluser]ivantcholakov[/eluser]
Code:
// Tested on CodeIgniter 3.0-dev

$table = 'table';
$name = 'John';
$zip_codes = array('0000', '0001', '0002');

echo $this->db
    ->select()
    ->from($table)
    ->where_in('Zipcode', $zip_codes)
    ->like('name', $name)
    ->get_compiled_select();

/*

Result query text:

SELECT *
FROM `table`
WHERE `Zipcode` IN('0000', '0001', '0002')
AND  `name` LIKE '%John%' ESCAPE '!'

*/


Messages In This Thread
Quotes in query - by El Forum - 10-21-2013, 01:18 AM
Quotes in query - by El Forum - 10-21-2013, 02:17 AM
Quotes in query - by El Forum - 10-21-2013, 02:40 AM
Quotes in query - by El Forum - 10-21-2013, 03:50 AM
Quotes in query - by El Forum - 10-21-2013, 05:00 AM
Quotes in query - by El Forum - 10-21-2013, 05:02 AM
Quotes in query - by El Forum - 10-21-2013, 05:16 AM
Quotes in query - by El Forum - 10-21-2013, 05:28 AM
Quotes in query - by El Forum - 10-21-2013, 05:36 AM
Quotes in query - by El Forum - 10-21-2013, 05:51 AM
Quotes in query - by El Forum - 10-21-2013, 06:10 AM
Quotes in query - by El Forum - 10-21-2013, 07:10 AM
Quotes in query - by El Forum - 10-21-2013, 07:15 AM
Quotes in query - by El Forum - 10-21-2013, 07:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB