Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created January 29, 2013 00:29
Show Gist options
  • Select an option

  • Save jehoshua02/4660598 to your computer and use it in GitHub Desktop.

Select an option

Save jehoshua02/4660598 to your computer and use it in GitHub Desktop.
Just playing around with a PHP SQL library idea ...
<?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