How i can select most common value with codeigniter |
It looks like you are trying to do something like this: http://stackoverflow.com/questions/76936...d-in-mysql
First of all, you need to select count(*) as magnitude, not id_blog as magnitude. Look at the example in that answer more closely. Secondly, you are mixing Active Record syntax ( $this->db->join() ) with the command for doing a simple query ( $this->db->query() ). I could be wrong, but I don't think you can mix those two things. I think you either need to add the join to the $this->db->query() statement, or use the Active Record syntax here: http://www.codeigniter.com/user_guide/da...ecord.html $this->db->select(), $this->db->get(), etc Make sure CodeIgniter is sending the query as you expect by using the profiler $this->output->enable_profiler(TRUE); or sending $this->db->last_query(); to the log |
Messages In This Thread |
How i can select most common value with codeigniter - by Smith - 11-30-2014, 09:55 PM
RE: How i can select most common value with codeigniter - by sv3tli0 - 11-30-2014, 11:56 PM
RE: How i can select most common value with codeigniter - by bclinton - 12-01-2014, 06:51 AM
RE: How i can select most common value with codeigniter - by Smith - 12-02-2014, 10:45 AM
|