Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of vinrunner  >  classDataObject  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example
Class: classDataObject
Store and retrieve MySQL table records as arrays
Author: By
Last change:
Date: 2009-03-11 05:08
Size: 1,421 bytes
 

Contents

Class file image Download
<style>
.cls
{
background-color:#0099FF; border-style:groove; padding:2 5 2 5; width:30px; color:#CC0000; font-family:Times New Roman, Times, serif; font-size:10px; text-decoration:none;
}
.cls1
{
background-color:#0099FF; border-style:groove; padding:2 5 2 5; width:30px; color:#000000; font-family:Times New Roman, Times, serif; font-size:10px; text-decoration:none;
}
.cls:hover
{
font-size:12px; text-decoration:underline; font-weight:bold;
}
</style>

<?php

/*Here is the db connection code ..

If you have a connection file please include here ...

*/

mysql_connect("localhost","root","");
mysql_select_db("test");


/* Include our db class here */

include("classDataObject.php");

/******** Create a new database object here ********/

$table=new dataObject("test_table");///put ur table name between the quotes if there are multipple tables Separate it by comma(table1,table2)

$table->createObject(2);///Pass the number of recors to fetch from the table.

/***If number of recors greater than zero*******************/

while($table->getRecord())
{
echo 
$table->id;
echo 
" : ";
echo 
$table->name
echo 
"<br/>";
}

///Put the pagination code at the end ****Pass the classes required 

$table->getPages("cls","cls1");

//$data['user_name']='shejin';

//$table->queryString("id = '7'");

//$table->updateRecord($data);

//echo "Enter table Name ";

?>