PHP Classes

File: example_4.php

Recommend this page to a friend!
  Classes of Bogdan Lupandin   MySQL Access Wrapper   example_4.php   Download  
File: example_4.php
Role: Example script
Content type: text/plain
Description: Example showing the fetch_rowset and fetch_row
Class: MySQL Access Wrapper
MySQL database access wrapper
Author: By
Last change: Brought it up to date with the main class
Date: 11 years ago
Size: 517 bytes
 

Contents

Class file image Download
<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
$tbl_name = '';

$sql = "SELECT * FROM " . $db->dbname;

$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>