[eluser]mikeymayhem[/eluser]
hey ive seen another thread on this topic but the posts there dont seem to be working for me can anyone shed some light on this topic i want to format the date like
this->db->select("DATE_FORMAT(post_date, '%W %M, %Y') AS date"); the field in the database is called post_date
Here's my method in my model
Code:
function get_gigs( $num,$offset ) {
$this->db->select('*');
$this->db->select("DATE_FORMAT(post_date, '%W %M, %Y') AS date");
$this->db->from('gigs');
$this->db->join('venues', 'venues.venue_id = gigs.venue_id');
$this->db->join('users' , 'users.user_id = gigs.user_id');
$this->db->where('active', '1');
$this->db->order_by('post_date');
$this->db->limit($num, $offset);
$query = $this->db->get();
return $query;
}
im getting this error
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM (`gigs`) JOIN `venues` ON `venues`.`venue_id` = `gigs`.`venue_id` JOIN `use' at line 2
tahnks in advance, guess its something stupid im missing