Welcome Guest, Not a member yet? Register   Sign In
How i can select most common value with codeigniter
#3

(This post was last modified: 12-01-2014, 06:58 AM by bclinton.)

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
Reply


Messages In This Thread
RE: How i can select most common value with codeigniter - by bclinton - 12-01-2014, 06:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB