Login   Register  
PHP Classes
elePHPant
Icontem

QDataObject: Access MySQL query results as objects

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Tom Schaefer
Name: Tom Schaefer is available for providing paid consulting. Contact Tom Schaefer .
Packages: 39 Browse all classes by Tom Schaefer Browse all classes by
Country: Germany Germany - PHP jobs in Germany
Age: ???
All time rank: 1119 in Germany Germany
Week rank: 102 Up4 in Germany Germany Up
Innovation award
Innovation award
Nominee: 9x

Winner: 1x


  Detailed description   Download Download .zip .tar.gz  
This package can be used to access MySQL query results as objects.

It can take a MySQL query result set resource handle as parameter and provides several types of functions to access the data from the result set.

It provides check or retrieve the result set data positions, as well retrieve the type and length of the respective columns.

The package provides implementations that use the regular MySQL and MySQLi extensions to access MySQL query results.

New:
DataObjectFactory

=== QMysqlDataObject ===
Test => SELECT * FROM geodb_textdata
TEST ENV:
Windows Vista Xampp, AMD Turion 64x2 Mobile 1.80 GHz
2 MB RAM (average performance)

1.a) object building runtime 0.176911115646s
on a db table with 337.925 records
(building uncached dataobject from uncached query at page offset 22210 by 10 rows/page)

1.b) object building runtime 0.275130033493s
on a db table with 337.925 records
(building uncached dataobject from uncached query at page offset 3000 by 100 rows/page)

2.a) object building runtime 0.0171821117401s
on a db table with 337.925 records
(building uncached dataobject from uncached query at page offset 10 by 10 rows per page)

2.b) object building runtime 0.0609588623047s
on a db table with 337.925 records
(building uncached dataobject from uncached query at page offset 10 by 100 rows per page)

3)

SELECT * FROM orders
LEFT JOIN customers on customers.CustomerID=orders.CustomerID

(northwind demo database)
object building runtime 0.055801153183s
(building uncached dataobject from uncached query at page offset 1 by 10 rows per page)
Mysql DB times:
Status runtime
(initialization) 0.0000377
Opening tables 0.0002247
System lock 0.0000032
Table lock 0.0000067
init 0.0000107
optimizing 0.0000037
statistics 0.0000107
preparing 0.00001
executing 0.0000467
Sending data 0.0002505
end 0.0000042
query end 0.0000035
freeing items 0.0000077
closing tables 0.000002
removing tmp table 0.0001105
closing tables 0.0000042
logging slow query 0.0000025

Conclusion:
Object building becomes much quicker if you operate with sql conditions.
The test above shows, that a cut on a deep offset is slow. So you have to reduce the data cloud by conditioning and so on.
(On a Linux Web server it will run much faster.)

Regards Tom Schaefer

  Classes of Tom Schaefer  >  QDataObject  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: QDataObject
Base name: qdataobject
Description: Access MySQL query results as objects
Version: 0.3
PHP version: 5.0
License: BSD License
All time users: 693 users
All time rank: 4251
Week users: 0 users
Week rank: 1960 Equal
 
  Groups   Screenshots Screenshots   Rate classes User ratings  
  Applications   Related links   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Databases Database management, accessing and searching View top rated classes

  Files folder image Screenshots  
UML
File Role Description
Accessible without login Image file uml.png Screen UML
Accessible without login Image file qtag.png Screen QTag UML


  User ratings  
Not yet rated by the users

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.

  Related links  
Link Description
QTag QTag - the smallest OO Markup Template Engine

  Files folder image Files  
File Role Description
Files folder imagever.0.4 (7 files)
Accessible without login Plain text file config.inc.php Conf. Configuration and Autoloading
Accessible without login Image file indicator1.gif Icon Indicator
Accessible without login Plain text file interface.js Data jquery interface plugin
Accessible without login Plain text file jquery.dimensions.js Data jquery dimension plugin
Accessible without login Plain text file jquery.js Data JQuery Lib
Accessible without login Plain text file northwind.sql Data Sample Northwind Database for MySQL
Plain text file QDataObject.class.php Class Data Object Class
Plain text file QDataObject.class.v3.php Class version 3: for version 3 adapater
Plain text file QMysqlDataObject.class.php Class Mysql Version v.0.2
Plain text file QMysqlDataObject.v3.class.php Class version 3: for working on large databases
Plain text file QMysqliDataObject.class.php Class MySqli Version v.0.2
Plain text file QMysqliDataObject.v3.class.php Class version 3: for working on large databases
Plain text file QTag.class.php Class QTag - the smallest OO Markup Template Engine
Accessible without login Plain text file readme.txt Doc. README
Accessible without login Plain text file sample.list.php Example sample for a result set as object list
Accessible without login Plain text file sample.mysqli.php Example sample for mysqli
Accessible without login Plain text file sample.mysqli.version.0.2..table.php Example Sample output as table
Accessible without login Plain text file sample.mysqli.version.0.2.php Example MySqli Version 0.2 Sample
Accessible without login Plain text file sample.php Example Sample for data object with one result object
Accessible without login Plain text file sample.using.qtag.php Example Sample Table using QTag
Accessible without login Plain text file sample.v3.mysql.php Example basic mysql version 3
Accessible without login Plain text file sample.v3.mysqli.php Example basic mysqli version 3
Accessible without login Plain text file sample2b.php Example Sample JQUERY
Accessible without login Plain text file sample2b1.php Example Sample JQuery Data Table
Accessible without login Image file slider_back.jpg Icon slider background

  Files  /  Files folder image ver.0.4  
File Role Description
  Accessible without login Plain text file model.xml Data Sample XML out of database scheme nothwind
  Plain text file QAdapterDataObject.class.php Class QAdapterDataObject class
  Plain text file QDataObject.class.php Class QDataObject Factory
  Plain text file QMysqlDataObject.class.php Class QMysqlDataObject
  Plain text file QMySqliDataObject.class.php Class QMySqliDataObject
  Accessible without login Plain text file readme.txt Doc. Readme
  Accessible without login Plain text file sample.php Example build model scheme form database

Download Download all files: qdataobject.tar.gz qdataobject.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.