Created
June 19, 2009 20:10
-
-
Save shadowhand/132868 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
<?php | |
$query = DB::select()->from('users') | |
->where_open() | |
->where('username', '=', 'shadowhand') | |
->where_open() | |
->or_where('last_login', 'is', NULL) | |
->or_where('last_login', '<', strtotime('now -1 day')) | |
->where_close() | |
->and_where('id', '>', 1) | |
->where_close(); | |
echo Kohana::debug((string) $query); |
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
SELECT * FROM `users` WHERE (`username` = "shadowhand" AND (`last_login` IS NULL OR `last_login` < 1245357421) AND `id` > 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment