Welcome Guest, Not a member yet? Register   Sign In
MySQL Query using ?deprecated? syntax
#3

[eluser]kgill[/eluser]
This
Code:
$this->db->select('CONCAT (firstname, \'.\', lastname) AS full_name');
$this->db->from('fa_user');
$this->db->from('user');
$this->db->where('fa_user_id = id');
$this->db->where('user_id', $new_to_user_id);

is the same as this:
Code:
select CONCAT(firstname, '.', lastname) AS full_name
  from fa_user, user
  where fa_user_id = id
  and user_id = $new_to_user_id

// OR this

  select CONCAT(firstname, '.', lastname) AS full_name
  from fa_user left join user on fa_user_id = id
  where user_id = $new_to_user_id

It's not really a depreciated syntax it's just an alternate way of writing things, where it gets useful is when you're dealing with lots of table joins, instead of nesting all the join clauses you just list the how the tables are linked in the where clause. By the way if AR is confusing you, you can use db->query and type the SQL statement directly if you need to get things fixed quickly.


Messages In This Thread
MySQL Query using ?deprecated? syntax - by El Forum - 08-22-2009, 06:55 AM
MySQL Query using ?deprecated? syntax - by El Forum - 08-22-2009, 10:47 AM
MySQL Query using ?deprecated? syntax - by El Forum - 08-22-2009, 12:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB