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 bala kumar  >  Query Process  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example for getting result by query.class.php
Class: Query Process
MySQL , PgSQL & MsSql database access wrapper
Author: By
Last change: Just changed the host name
Date: 9 years ago
Size: 904 bytes
 

Contents

Class file image Download
<?

include 'dblib.php';

/**************************************************************************************
 Constructor Parameters :
    query_process("SQL type" , "Host" , "DB name" , "Username" , "Password" ,"Port"); 
 if Port is not present then,leave that parameter ie                         
    query_process("SQL type" , "Host" , "DB name" , "Username" , "Password"); 
***************************************************************************************/

$my_sql=new query_process("mysql","localhost","baladb","root","bala");

$ans=$my_sql->query_pass("select * from student","4");
for(
$i=0$i<count($ans); $i++){
  echo 
$ans[$i]['name'].'<br>';
}

echo 
'<hr>';

$ms_sql=new query_process("mssql","localhost","pubs","sa","sysadm");

$ans2=$ms_sql->query_pass("select * from Emp","4");
for(
$i=0$i<count($ans2); $i++){
  echo 
$ans2[$i]['name'].'<br>';
}

?>