Welcome Guest, Not a member yet? Register   Sign In
SOLVED: Database help - problem with dynamic name
#1

[eluser]rvillalon[/eluser]
I seem to be getting errors in the join clause:

$this->db->select('username, message, date_created');
$this->db->from(self::TBL_SHOUTBOX);
$this->db->join(self::TBL_USERS, self::TBL_USERS + '.id = shoutbox.uid');
$this->db->where('did', $did);
$this->db->limit(10, 0);
$this->db->order_by("date_created", "desc");
$result = $this->db->get();

How can I use self::TBL_USERS for 'users.id = shoutbox.uid'? Above code doesn't work


UPDATE: THIS WAS CORRECT
#2

[eluser]rvillalon[/eluser]
actually... for some reason if I use the "+" to concatenate, it breaks. use "." and it will solve the problem




Theme © iAndrew 2016 - Forum software by © MyBB