Skip to content

Instantly share code, notes, and snippets.

@gaurish
Created July 15, 2011 21:14
Show Gist options
  • Save gaurish/1085562 to your computer and use it in GitHub Desktop.
Save gaurish/1085562 to your computer and use it in GitHub Desktop.
<?php
//mysql extension way
$id = 10;
$rs = mysql_query("SELECT name from users where id=$id");
//PDO way
$stmt = $dbh->prepare("SELECT * FROM REGISTRY where name LIKE '%?%'");
$stmt->execute($id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment