Welcome Guest, Not a member yet? Register   Sign In
string based custom ordering in active record
#6

[eluser]TheFuzzy0ne[/eluser]
Please edit your post and put your code into [code][/code] tags.

F'ugly code:

$this->db->select(‘i.id, condition, description, created_at, updated_at, category, latitude, longitude, status,
d.device_token, d.facebook, d.preferred, d.email, d.phone’);
$this->db->select(“CONCAT( ‘$url’, image_url_original ) AS image_url_original”);
$this->db->select(“CONCAT( ‘$url’, image_url_mid ) AS image_url_mid”);
$this->db->select(“CONCAT( ‘$url’, image_url_thumb ) AS image_url_thumb”);

$this->db->from(‘item as i’);
$this->db->join(‘device as d’, ‘i.device_id = d.device_token’);

$this->db->where(‘created_at > DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR)’);
$this->db->where(‘i.status’,‘shared’);

Neater code:
[code]
Code:
$this->db->select(‘i.id, condition, description, created_at, updated_at, category, latitude, longitude, status,          
    d.device_token, d.facebook, d.preferred, d.email, d.phone’);
$this->db->select(“CONCAT(  ‘$url’,  image_url_original ) AS image_url_original”);
$this->db->select(“CONCAT(  ‘$url’,  image_url_mid ) AS image_url_mid”);
$this->db->select(“CONCAT(  ‘$url’,  image_url_thumb ) AS image_url_thumb”);

$this->db->from(‘item as i’);
$this->db->join(‘device as d’, ‘i.device_id = d.device_token’);

$this->db->where(‘created_at > DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR)’);
$this->db->where(‘i.status’,‘shared’);
[/code]


Messages In This Thread
string based custom ordering in active record - by El Forum - 03-23-2013, 04:55 AM
string based custom ordering in active record - by El Forum - 03-23-2013, 06:33 AM
string based custom ordering in active record - by El Forum - 03-23-2013, 09:35 AM
string based custom ordering in active record - by El Forum - 03-23-2013, 10:02 AM
string based custom ordering in active record - by El Forum - 03-23-2013, 08:15 PM
string based custom ordering in active record - by El Forum - 03-24-2013, 04:11 AM
string based custom ordering in active record - by El Forum - 03-24-2013, 05:09 AM
string based custom ordering in active record - by El Forum - 03-24-2013, 07:09 AM
string based custom ordering in active record - by El Forum - 03-27-2013, 03:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB