PHP Classes

File: selectTest.php

Recommend this page to a friend!
  Classes of Cuthbert Martin Lwinga   PHP MySQL Handling Class   selectTest.php   Download  
File: selectTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP MySQL Handling Class
Execute common MySQL database queries using MySQLi
Author: By
Last change:
Date: 11 months ago
Size: 1,193 bytes
 

Contents

Class file image Download
<?PHP
include_once("headers.php");

function
innerJointest(){
       
$sql = new MySql(Database::test, UserConnection::username, UserConnection::password); // set up your username and password for ur mysql
       
       
$sql = MySql::Table("accounts");
       
$sql->select(array("id"=>"","FirstName"=>"","LastName"=>"Lwinga"));
       
       
$sql2 = MySql::Table("AccessRecords");
       
$sql2->select(array("userId"=>"","accessLevel"=>""),true);

       
$sql->INNERJOIN($sql2);
       
$sql->ON(([[$sql->getTablecol("id"),$sql2->getTablecol("userId")]]));
       
$output = $sql->CheckOutSelect();

        if(
$output!=NULL){
            if(
$output->num_rows>0){
                while(
$row = $output->fetch_assoc()){
                   
var_dump($row);
                    echo
" \n";
                }

            }
        }
    }
function
selectTest(){
           
$sql = new MySql(Database::test, UserConnection::username, UserConnection::password); // set up your username and password for ur mysql
       
       
$sql = MySql::Table("accounts");
   
$sql->select(array("id"=>"","FirstName"=>"","LastName"=>"Lwinga"));
   
$output = $sql->CheckOutSelect();

    if(
$output!=NULL){
        if(
$output->num_rows>0){
            while(
$row = $output->fetch_assoc()){
                echo
"id: ".$row["id"]." FirstName: ".$row["FirstName"]." \n";
            }

        }
    }

    }


   
selectTest();
?>