01-17-2009, 10:30 PM
|
#62 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
So let me get this straight with an example. Basically we'll connect to the database and return some results:
PHP Code:
$db = new DBmysql;
$db->setHandler('localhost', 'root', 'mysupersecretpassword', 'phlox_dev')
->connect()
->select();
$sql = 'SELECT * FROM sample'; // Assume columns: id, title
// Get associative array of rows
$rows = $db->getFetch(true, true, $sql);
// or $rows = $db->exeQuery($sql)->loadFetch(true)->getFetch();
// or $rwos = $db->loadQuery($sql)->exeQuery()->getFetch(true, true);
// or $rows = $db->loadFetch(true, $sql)->getFetch();
foreach ($rows as $row)
{
sprintf("Yay I got record ID: %d\n", $row['id']);
}
|
|
|
|