Login   Register  
PHP Classes

File: mysql_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jeremy Stansfield  >  mysqlRecordSet  >  mysql_example.php  >  Download  
File: mysql_example.php
Role: Example script
Content type: text/plain
Description: small example script, for using record set object
Class: mysqlRecordSet
Creates MySQL connection and record set objects
Author: By
Last change: added mysql object declaration
Date: 11 years ago
Size: 529 bytes


Class file image Download
// make sure you set the global variables in the mysql.php file
include "mysql.php";
// this returns a record set
$rsObj RS("SELECT `name`,`description` FROM `people`");
$rsObj->eof) { // while not at end of file (end of record set)
echo $rsObj->field['name']."<br>&nbsp;&nbsp;".$rsObj->field['description']; // echo results
$rsObj->move_next(); // move to the next record
$rsObj->free(); // free the result set from memory