Created
November 27, 2012 22:37
-
-
Save slave2zeros/4157656 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select * from tours; | |
+----+------------------+-------------+------------------+---------------------+ | |
| id | tour_name | eg_env | kera_tutorial_id | created_at | | |
+----+------------------+-------------+------------------+---------------------+ | |
| 2 | Team site signup | development | 650a40430f | 2012-11-26 17:01:39 | | |
| 3 | Team site signup | staging | b283456766 | 2012-11-26 17:01:39 | | |
| 4 | Team site signup | production | 94af058d3a | 2012-11-26 17:01:39 | | |
+----+------------------+-------------+------------------+---------------------+ | |
3 rows in set (0.00 sec) | |
mysql> describe tours_users | |
-> ; | |
+--------------+------------------+------+-----+---------+----------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+--------------+------------------+------+-----+---------+----------------+ | |
| id | int(11) unsigned | NO | PRI | NULL | auto_increment | | |
| tour_id | int(11) unsigned | YES | MUL | NULL | | | |
| user_id | int(11) unsigned | YES | MUL | NULL | | | |
| started_at | timestamp | YES | | NULL | | | |
| completed_at | timestamp | YES | | NULL | | | |
+--------------+------------------+------+-----+---------+----------------+ | |
5 rows in set (0.01 sec) | |
$q = Doctrine_Query::create() | |
->from('TourUser as tu') | |
->leftJoin("tu.Tour t ON tu.tour_id = t.id") | |
->where('t.tour_name = ', $name) | |
->where('t.eg_env = ?', EG_ENV); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment