View Single Post
  #9 (permalink)  
Old 06-03-2008, 10:48 AM
mel mel is offline
Junior Member
 
Join Date: Feb 2008
Posts: 11
Default

I think I'm having the same problem as the OP. I have 2 tables with correctly defined relationships, message and user. I want to get all messages (as a RowSet) for all users who meet certain criteria. Sort of like:

SELECT m.* FROM messages m
JOIN users u on u.id = m.user_id
WHERE u.name LIKE 'fred%'

At the moment, I'm doing (inside the Message class, ignoring quoting):
PHP Code:
$select $this->select();
$select->join('user''user.id = message.user_id')
         ->
where('u.name LIKE ?'$name); 
My question: Is this possible, and how??? If it's not possible, it seems to me a major failing of the framework.
Reply With Quote