problem with where clause!!! |
[eluser]immi[/eluser]
Hi I am making a page which display videos on controller i added microtime(true) for table field 'lastwatch'. I want to grab the records on a page where lastwatch is lower than 300 seconds but it makes me error Code: function sqldiff($time){ I get this error Quote:A Database Error Occurred KINDLY HELP!!!
[eluser]JHackamack[/eluser]
You can't mix a PHP function with a mysql column. Take a look at MySQL Timestamp Diff: http://dev.mysql.com/doc/refman/5.5/en/d...n_timediff
[eluser]immi[/eluser]
thanks! I have turned it different way like this $value = microtime(true) - 2000; $value = $this->db->escape($value); $config['total_rows'] = $this->db->query("SELECT * from vid_info where lwatch > $value order by lwatch desc")->num_rows(); Thnx |
Welcome Guest, Not a member yet? Register Sign In |