Skip to content

Instantly share code, notes, and snippets.

@rsalmond
Created June 18, 2014 17:50
Show Gist options
  • Save rsalmond/8e9442de0b7055c090aa to your computer and use it in GitHub Desktop.
Save rsalmond/8e9442de0b7055c090aa to your computer and use it in GitHub Desktop.
Tracing a few queries in PHP.
<?php
try {
$pdo = new PDO('sqlite::memory:');
} catch(PDOException $e) {
echo $e->getMessage();
}
oboe_log_entry('my_layer');
$create_table = "CREATE TABLE users(
name VARCHAR ( 100 ),
email VARCHAR ( 100 ),
password VARCHAR ( 100 ));";
$pdo->exec($create_table);
$add_user = "INSERT INTO users (name, email, password) VALUES ('rob', '[email protected]', 'TooManySecrets');";
$pdo->exec($add_user);
$get_user = "SELECT * FROM users WHERE name='rob';";
$pdo->exec($get_user);
oboe_log_exit('my_layer');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment