WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Recordset Class for MSSQL database
Categories : PHP Classes, Databases, PHP, MS SQL Server Update Picture
Antonio Antonio
Date : Feb 15th 2001
Grade : 3 of 5 (graded 5 times)
Viewed : 18977
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Antonio Antonio
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?
class Recordset {
var $result, // result id
$rowcount, // number of rows in result
$curpos, // index of current row (begin=0, end=rowcount-1)
$fieldcount, // number of fields in result
$fn, // Array of fields names
$rowset, // Array of fields with keys on field name
$connection, // connection id
$sql; // sql query

//Constructor

function Recordset($Sql,$Conn) {
$this->connection=$Conn;
$this->sql=$Sql;
$this->fn=array();
$this->rowset=array();
$this->Query();
}

// Execute query

function Query() {
$this->Close();
$this->result = @mssql_query($this->sql,$this->connection);
if (!$this->result)
return(0);
$this->rowcount = @mssql_num_rows($this->result);
$this->fieldcount = @mssql_num_fields($this->result);
for ($i=1;$i<=$this->fieldcount;$i++) {
$f=@mssql_fetch_field($this->result,$i-1);
// Fill fields names array
$this->fn[$i]=$f->name;
}
$this->curpos=0;
}

//Move to first record

function MoveFirst() {
$this->curpos=0;
}

//Return current row elements and move to next record

function MoveNext() {
if (!$this->result) return(0);
if ($this->curpos==$this->rowcount) return(0);
for($i=1;$i<=$this->fieldcount;$i++)
$this->rowset[$this->fn[$i]] = @mssql_result($this->result,$this->curpos,$this->fn[$i]);
$this->curpos++;
return($this->rowset);
}

//Return true if last record

function Eof() {
if ($this->curpos==$this->rowcount-1)
return(1);
return(0);
}

//Return true if first record

function Bof() {
if (!$this->curpos)
return(1);
return(0);
}

// Free result if exist

function Close() {
if ($this->result && $this->rowcount)
mssql_free_result($this->result);
$this->result=0;
$this->fn=array();
$this->rowset=array();
$this->rowcount=0;
$this->fieldcount=0;
}
}
?>



Mssql database Manager
Categories : PHP, Databases, MS SQL Server, Classes and Objects, PHP Classes
Convert SQL from oracle,mysql,mssql,sqlite and odbc to SQL compatible
Categories : PHP, PHP Classes, Databases, MySQL, MS SQL Server
[PHP5] aDB PDO LIKE Database Abstraction. Switch easily from one db server to another, strong errors management, manage transactions, queries preparation and more.
Categories : PHP, PHP Classes, Databases, MS SQL Server, MySQL
Simple class for accessing databases like MSSql Server, Oracle etc by Raju
Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle
Ajax PHP Tree (Left and Right) with MySQL
Categories : PHP, Databases, MySQL, AJAX, PHP Classes
YellowPages Content Grabber (PHP5 +)
Categories : PHP, PHP Classes, Regexps, Databases, MySQL
TAB_STRUCT Class: Is supporting Class for the DBXML Class
Categories : PHP, PHP Classes, MySQL, XML, Databases
MySQL database class
Categories : PHP, MySQL, Databases, PHP Classes
Use this class to connect your database transparently...
Categories : PHP Classes, Databases, PHP
Recordset Class like ADO Recordset (plus DataBase Splitting feature) using ODBC functions
Categories : PHP Classes, ODBC, Databases, PHP
Setting up InnoDB on MySQL and using Transactions Begin, Commit, Rollback in PHP.
Categories : PHP Classes, Databases, PHP, MySQL, InnoDB
PHP Transfer data from text file to Mysql Table
Categories : PHP, PHP Classes, Filesystem, Databases, MySQL
Unable to select text bigger than 4K from MSsql
Categories : PHP, WinNT, Databases, MS SQL Server
Sort the results from a SELECT query (any number of columns) into an array automatically.
Categories : PHP, PHP Classes, Arrays, Databases, MySQL
usercounter class
Categories : PHP, PHP Classes, Databases, MySQL, Environment Variables