PHP Classes
elePHPant
Icontem

File: example2.php

Recommend this page to a friend!
  Classes of Moritz HeidkampPreview the content newsletter M  >  iviArray  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Explaining conversion of database result resources
Class: iviArray
Encapsulation of PHP array functions
Author: By
Last change: added parameter true (use associative arrays)
Date: 12 years ago
Size: 396 bytes
 

Contents

Class file image Download
<?php

 
require_once('iviArray.class.php');

 
mysql_connect('localhost', 'root', '') or die(mysql_error());
 
mysql_select_db('db');
 
 
$result = mysql_query('SELECT * FROM table') or die(mysql_error());
 
 
$array = new iviArray();
 
$array->fetch($result, true, 'mysql');

 print(
'<pre>');
 
 
 
$array->display();
 
$array->sort();
 
$array->display();
 
 print(
'</pre>');
 
?>