PHP Classes

mysql_db: MySQL Database access & control classes

Recommend this page to a friend!
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 62%Total: 6,383 All time: 332 This week: 310Up
Version License Categories
mysql_db 1.0GNU General Publi...Databases
Description Author

Current release: 1.1
mysql_db classes conform a mysql access frame for a multiple result environment as a group of base classes (connection, recordset and command) and some extra TOOL interfaces to perform management and informative tasks.

Picture of Carlos Falo Hervás
Name: Carlos Falo Hervás <contact>
Classes: 10 packages by
Country: Spain Spain
Age: 47
All time rank: 361 in Spain Spain
Week rank: 587 Down25 in Spain Spain Down
Innovation award
Innovation award
Nominee: 1x

Details
===== BASIC DOCUMENTATION FOR mysql_db DATABASE ACCESS CLASS ===== ===== Release 1.1 - 06/08/2002 ===== Released under GNU GPL Library (see LICENSE for details) 0.- INTRODUCTION This group of classes was developed to provide a full mysql_management package intended for a multiple result environment. Base architecture for the group was ADODB classes from Microsoft ActiveX ADODB ODBC data interface. This classes are subject to continuous code evolution and will be kept up to date on php classes repository (http://phpclasses.upperdesign.com/mysql_db). 1.- INTERFACE Data interface is formed from three base objects: - mysql_conn : The connection object. This object is used for database connection managing, logging operations and data connection initialization and destruction. Public interface: mysql_conn($servername,$username,$password,$databasename,$debuglevel=0) -> constructor init() -> Initialize logging operations and opens the data connection destroy() -> Closses connection and ends logging operations NOTE debug_level is one of the following constants: · LOG_NONE or 0 : No logging for the database operations · LOG_ECHO or 1 : Echoes logging directly to HTML code · LOG_HIDE or 2 : Echoes silently (<!-- -->) to HTML code · LOG_FILE or 3 : Echoes to a file - mysql_recordset : The result handler object. This object is used to retrieve data from a database. Requires an active mysql_conn object to work and is intended for multiple result handling. Public interface: mysql_recordset($connobjname,$sqlcommand) -> Constructor requires the variable name for the connection object int query() -> Performs the execution of $sqlcommand and returns number of records in the result but result index IS NOT INITIALIZED (see movenext()) int movenext() -> Advances result index (first execution points to first record) and returns true OR false for EOF (end of result, true no more records) field($fieldname) -> echo value of field $campo on screen (movenext() MUST HAVE BEEN SUCCESFULLY CALLED AT LEAST ONCE TO INITIALIZE ROW INFORMATION) var value($fieldname) -> returns the value for field $campo (movenext() MUST HAVE BEEN SUCCESFULLY CALLED AT LEAST ONCE TO INITIALIZE ROW INFORMATION) clear_recordset() -> clears $sqlcommand and frees result memory move_to($rnumber) -> moves the result pointer to row $rnumber, it is 0 aware so move_to(0) places result pointer on first row movefirst() -> executes move_to(0) so points first row movelast() -> executes move_to($this->recordcount-1) so points last row - mysql_command : The SQL commands interface. This object is intended for database SQL operations that do not return any data (DELETE, UPDATE, etc) and requires an active mysql_conn object Public interface: mysql_command($connobjname,$sqlcommand) -> Constructor, requires variable name for the mysql_conn object int execute() -> Performs the execution of $sqlcommand and returns affected rows count Additional TOOLS interface: - mysql_tools: The Tools interface allows for a basic mysql server information and table structures for the current dabase Rrequires an active connection object (mysql_connection). Public interface: mysql_tools($connobjname) -> Constructor, requires variable name for the mysql_conn object list_tables() -> Generates a very basic HTML table with the list for all the tables in the currently active database for the connection object describe_table($tblname) -> Generates a very basic HTML table with the structure for the table $tblname IF IT EXISTS, or just says the table does not exist. server() -> Echoes basic information from the mysql server you are connected to analyze() -> Generates a very basic HTML formated block with the combined results for all the above methods (server, list_tables & describe_table for each table in the database) 2.- Future releases and WIP This class is provided as is, and is subject to changes. New releases will be posted at http://www.phpclasses.org/mysql_db repository. Any suggestions and new feature requests are wellcome 3.- Contact information Carlos Falo Hervás carles@bisinteractive.net http://www.bisinteractive.net C/Manila 54-56 Esc. A Ent. 4ª 08034 Barcelona Spain Phone: +34 9 3 2063652 Fax: +34 9 3 2063689
  Files folder image Files  
File Role Description
Accessible without login Plain text file data_mysql_ex.txt Doc. Some examples
Accessible without login Plain text file LICENSE Doc. GNU GPL License
Plain text file mysql_command.php Class base SQL command interface class
Plain text file mysql_connection.php Class Base mysql connection class
Plain text file mysql_recordset.php Class Base result handling class
Plain text file mysql_tools.php Class Extra TOOLS interface
Accessible without login Plain text file README.txt Doc. Documentation for mysql_conn, mysql_recordset and mysql_command
Accessible without login Plain text file sample_logfile.txt Output An example of log data generated by the classes

 Version Control Unique User Downloads Download Rankings  
 0%
Total:6,383
This week:0
All time:332
This week:310Up
 User Ratings  
 
 All time
Utility:90%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:84%StarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:1090