Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Lawliet  >  Plottable Online Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Plottable Online Class
Store online users statistics in a MySQL database
Author: By
Last change:
Date: 10 years ago
Size: 819 bytes
 

Contents

Class file image Download
<?php
//Require the Class
    
require_once("ponline.php");
//Creates a child class so as to configure the variables
class online extends ponline{
    function 
online(){
        
$this -> sql_user "user";
        
$this -> sql_password "123456789;
        
$this -> sql_dbname = "";
        
$this -> sql_table = "ponline_";
        
$this -> ponline();
    }
}
//Creats a new instance of the class
$online = new online;
//Check for table
if (
$online -> table_exists() == false){
    echo "
Table not found!";
    //Creates the table
    
$online-> create_table(true);
}
else{
    echo "
Table exists";
}
echo "
<hr>";
//Updates the list and prints the number of users online
print_r(
$online -> update_list());
echo "
<hr>";
//Query numbers
echo "
NoQueries$online->sql_query_no<br><hr>";
//Error Messages
print_r(
$online -> error("all"));
?>