Created
September 2, 2010 16:20
-
-
Save jakemcgraw/562500 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// More info at http://framework.zend.com/manual/en/zend.db.adapter.html | |
// Assumes Zend dir is in your include path | |
require_once 'Zend/Db.php'; | |
$db = Zend_Db::factory('Pdo_Mysql', array( | |
'host' => '127.0.0.1', | |
'username' => 'webuser', | |
'password' => 'xxxxxxxx', | |
'dbname' => 'test' | |
)); | |
$db->setFetchMode(Zend_Db::FETCH_OBJ); | |
// NO BIND/PARAMETER NONSENSE | |
$result = $db->fetchAll('SELECT * FROM bugs WHERE bug_id = ?', $_GET['bug']); | |
if (null !== $result) { | |
echo $result[0]->bug_description; | |
} | |
else { | |
echo "Could not find bug"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment