View Single Post
Old 01-16-2008, 10:21 PM   #7 (permalink)
TlcAndres
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default Updated with new goodies

Sorry if it's annoying asking to go through my classes but I like feedback to further myself as a programmer, anywho...

The class handles MySQL,MSSQL, SQLite, PostgreSQL, Ibase, and has a generic ODBC driver

(please note, the classes don't dwelve into any of the special function provided by each of the databases, the class is only meant to retrieve data in an easy to use format)


created an escapestring function which works generically on everything...the bugginess an obtrusiveness of it has not been heavily tested so any feedback is more than welcome..

PHP Code:
//example of it
$db->escapeString($_GET['thingy']); 
added a SqlEParse function which works something like sprintf or sprintsql(<-- my own function), it works basically like sprintf but it escapes every replacement character

PHP Code:
//example of it
$db->SqlEParse('some %s random %s',"stuf'f -- here is","w'oot"); 
added a sprintsql function which acts like sprintf but in tangest with a callback it takes the callback and acts upon all the strings which is not the sql statement or the callback itself

PHP Code:
//example of it
$db->sprintsql('some %s stuff, %s',"ra'ndom","here'",'addslashes'); 

Beyond that all the variables and such have been abstracted to the VariableScope class (new) so that they may easily accessed by all three classes (DB_handle,Record, DB driver)

It probably has a load of bugs and I'd be very grateful to anyone who is willing to test it out as well

Also the speed or lack there of is of concern to me so it's slow for anyone that feedback is also appreciated

(P.S. Salathe, your more than welcome to take a go at my code, or anyone else who feels like it too...Constructive criticisms is awesome)
Attached Files
File Type: rar dbabs.rar (6.8 KB, 25 views)
TlcAndres is offline  
Reply With Quote