Skip to content

Instantly share code, notes, and snippets.

@aziflaj
Created March 14, 2015 12:16
Show Gist options
  • Save aziflaj/ee458098ebbd387cb43d to your computer and use it in GitHub Desktop.
Save aziflaj/ee458098ebbd387cb43d to your computer and use it in GitHub Desktop.
<?php
try {
$conn = new \PDO("mysql:host=127.0.0.1;dbname=DragonBallZ", $username, $password);
} catch (\PDOException $ex) {
print "Error!" . $ex->getMessage() ;
exit();
}
$select = "SELECT character_name FROM super_saiyan WHERE power > 9000;";
$resultSet = $conn->query($select);
foreach ($resultSet as $result) // this should print Goku!
print $result['character_name'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment