Welcome Guest, Not a member yet? Register   Sign In
order_by from another table
#1

[eluser]Unknown[/eluser]
Hi, I need a help..

I have 2 tables and I join it.

the tables are like this:
Code:
create table table1
(
   id char(5) primary key,
   name varchar(100),
)

create table table2
(
   id char(5) primary key,
   score int
)

Code:
$this->db->join('table2', 'table1.id = table2.id');
$this->db->order_by('score');
$this->db->get('table1');

I need to order by score.
anyone can help me..?




Theme © iAndrew 2016 - Forum software by © MyBB