xjermx Posted April 19, 2012 Share Posted April 19, 2012 I've recently picked up CodeIgniter 2 + Doctrine 2, which is incredibly powerful. I'm learning as I go. I have what someone told me is called a 'join table'. Two tables that only have useful information when linked together. Its a messaging system in my webapp. You send a message to three other users, it writes to two tables. One table contains who its from, the message text, a timestamp and a primary key. The second table contains a primary key, a "to" field, and a msg_id that is meant to join back to the primary key in the other table. If I was just using native sql statements, here's what this would look like: SELECT * FROM mail_links a INNER JOIN mail_msgs b ON a.msg_id = b.id But I'm trying to figure out what the "right" way is to do this in Doctrine2. Is it Associative Mapping? Is it something else? Link to comment https://forums.phpfreaks.com/topic/261218-help-association-mapping-or-join-doctrine2/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.