PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Jorge Machin   shmem   example.php   Download  
File: example.php
Role: ???
Content type: text/plain
Description: Example file
Class: shmem
Author: By
Last change:
Date: 22 years ago
Size: 1,563 bytes
 

Contents

Class file image Download
<?php include 'shmem.inc'; // Field Size Array $fields[Name] = 20; $fields[City] = 10; // Share Memory object $proy = new shmem( 0xf00, $fields, 100, true ); // Insert a register $register = $proy->find('Name','Jorge Machin'); if ( $register == NULL ) { $data[Name] = 'Jorge Machin'; $data[City] = 'Australia'; $proy->insert($data); } else { echo '-----<BR>'; echo 'Jorge Machin is already in the shared memory<BR>'; echo "City: $register[City]<BR>"; } // Insert a register $register = $proy->find('Name','Luz Maria'); if ( $register == NULL ) { $data[Name] = 'Luz Maria'; $data[City] = 'Mexico'; $proy->insert($data); } else { echo '-----<BR>'; echo 'Luz Maria is already in the shared memory<BR>'; echo "City: $register[City]<BR>"; } // Insert a register $register = $proy->find('Name','Regina Urbina'); if ( $register == NULL ) { $data[Name] = 'Regina Urbina'; $data[City] = 'USA'; $proy->insert($data); } else { echo '-----<BR>'; echo 'Regina Urbina is already in the shared memory<BR>'; echo "City: $register[City]<BR>"; } // Display memory contents: echo '-----<BR>'; $proy->listAll(); // Update a register; $data[Name] = 'Miriam'; $data[City] = 'Mexico'; $proy->update( 'Name', 'Jorge Machin', $data ); // Display memory contents: echo '-----<BR>'; $proy->listAll(); // Delete a register $proy->delete('Name','Miriam'); echo '-----<BR>'; $proy->listAll(); ?>