Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $conn = $this->getEntityManager()->getConnection();
- $sql = "SELECT rc.id, rc.user_nick_name, rc.departure_city, rc.arrival_city,
- rc.departure_datetime, DATE_FORMAT(CONVERT_TZ(rc.departure_datetime,'UTC',rc.timezone), '%Y-%m-%d %H:%i:%s') AS departure_datetime,
- u.score
- FROM `routes_current` AS rc
- LEFT JOIN `users` AS u ON (u.nick_name = rc.user_nick_name)
- WHERE `departure_city` = 'departure_City1'
- #AND `departure_datetime` >= ( SELECT DATE_FORMAT( UTC_TIMESTAMP( ) , '%Y-%m-%d %H:%i:%s' ) )
- ORDER BY `departure_datetime` ASC";
- $stmt = $conn->query($sql);
- return $stmt->fetch();
- Array
- (
- [id] => 1
- [0] => 1
- [user_nick_name] => nick_Name1
- [1] => nick_Name1
- [departure_city] => departure_City1
- [2] => departure_City1
- [arrival_city] => arrival_City1
- [3] => arrival_City1
- [departure_datetime] =>
- [4] => 1999-09-02 09:19:20
- [5] =>
- [score] => 1
- [6] => 1
- )
Add Comment
Please, Sign In to add comment