Created
January 29, 2013 00:29
-
-
Save jehoshua02/4660598 to your computer and use it in GitHub Desktop.
Just playing around with a PHP SQL library idea ...
This file contains hidden or 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 | |
| // get a user | |
| $user = Sqlph::select('user') | |
| ->where('username')->equals($username) | |
| ->and('password')->equals($password) | |
| ->limit(1) | |
| ->fetch(); | |
| echo sprintf('Hello, %s!', $user->username); // access this way? | |
| echo sprintf('Hello, %s!', $user->get('username')); | |
| echo sprintf('Hello, %s!', $user->getUsername()); | |
| echo sprintf('Hello, %s!', $user->username()); | |
| // get products matching search term | |
| $products = Sqlph::select('product') | |
| ->where('name')->like($search_term); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment