Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

Calculate 2 fields with Active records

$
0
0
I have a table with fields
[Image: Rz9ByFZ_RUGgBsAsGxTaiA.png]

I want to looking for some records expired date in 6days.
today - test_time (created date) < duration - 6 days

My code don't work
Code:
$this->db->select("test.*");

$this->db->from('test');

$current_time = time();
$pre7day = $current_time - 7*60*60*24;
$next7day = $current_time + 7*60*60*24;
$this->db->where("duration * con <=", $next7day);
return $this->db->get();
This is a error:
Quote:Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`con` <= 1508605807' at line 3

SELECT `ospos_test`.*FROM `ospos_test`WHERE `duration *` `con` <= 1508605807

Filename: vendor/codeigniter/framework/system/database/DB_driver.php

Line Number: 691

Please help me.

Thanks.
ho

Viewing all articles
Browse latest Browse all 14348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>