Welcome Guest, Not a member yet? Register   Sign In
Working with CURRENT_TIMESTAMP
#4

[eluser]CroNiX[/eluser]
for more complex wheres (using functions), you probably need to enter it as a single string.
Code:
$this->db->where('CURDATE() BETWEEN ' . $startDate . ' AND ' . $endDate);

When using functions in selects, you should do something like:
Code:
$this->db->select('id');
$this->db->select('COUNT(id) AS total', FALSE);
use FALSE for 2nd parameter so it won't protect the identifiers which messes up on function names

And as always, run a
Code:
echo $this->db->last_query();
to see what SQL was actually compiled from AR.


Messages In This Thread
Working with CURRENT_TIMESTAMP - by El Forum - 09-11-2012, 10:14 AM
Working with CURRENT_TIMESTAMP - by El Forum - 09-11-2012, 11:55 AM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 01:15 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 01:31 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 01:59 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 02:02 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 02:08 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 02:09 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 02:12 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 02:18 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 04:24 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 04:30 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-12-2012, 05:34 PM
Working with CURRENT_TIMESTAMP - by El Forum - 09-13-2012, 03:58 AM
Working with CURRENT_TIMESTAMP - by El Forum - 09-13-2012, 06:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB