Location: PHPKode > scripts > Ultimate DB Access Wrapper > ultimate-db-access-wrapper/example_4.php
<p>Using <strong>fetch_rowset</strong> and <strong>fetch_row</strong></p>
<br />
<strong>fetch_rowset</strong>
<blockquote><pre>
<?php
require_once "db.php";
$db = new db();

// Fill in the following
$db->user = '';
$db->host = '';
$db->pass = '';
$db->dbname = '';
$tbl_name = '';

$sql = "SELECT * FROM $tbl_name";

$results = $db->fetch_rowset($sql);

print_r($results);

echo "</pre></blockquote><p>Fetching only the first row (<strong>fetch_row</strong>)</p><blockquote><pre>";
$results = $db->fetch_row($sql);

print_r($results);
?></pre></blockquote>
Return current item: Ultimate DB Access Wrapper