Created
June 18, 2014 17:50
-
-
Save rsalmond/8e9442de0b7055c090aa to your computer and use it in GitHub Desktop.
Tracing a few queries in PHP.
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 | |
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