Created
June 16, 2010 20:14
-
-
Save jamsesso/441198 to your computer and use it in GitHub Desktop.
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 | |
//Get the library. | |
require "mysql.php"; | |
//New connection. | |
$db = new MySQL("localhost", "username", "password", "database"); | |
if($db->errno()) | |
{ | |
print($db->error()); | |
exit; | |
} | |
$select = $db->prepare("SELECT * FROM table WHERE something = :something AND place = :place LIMIT 1"); | |
$select.= $db->bind(array(":something", ":place"), array("cars", "canada")); | |
$select.= $db->execute(); | |
$row = $db->fetch($select, OBJECT); | |
echo "Hi there, ".$row->something; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment