Page 1 of 2
understandable MySQL Class(es)
Posted: Sat Dec 03, 2005 7:00 pm
by markg85
Hello,
i was just looking for a nice good mysql class with alot of options so if possibloe all mysql_* functions.
I found a few scripts who where good enough but what i really miss is a clear documentation of how to use that class.. i`m just new in classes and i don`t know exactly how it`s working but some classes really don`t make it easy
So here`s my question do you guys have/or know where to get a class that has the following:
all or atleast the most used mysql_* functions
a functions to show the total query usage
and a easy to use class... easy is this:
$db->fetch_array("SELECT * FROM bla bla bla.............."); <-- that`s the usage in scripts!!
and something like this to display the total query usage: $db->totals(); or something like it...
any help would be fine
i could make my own class but it would take me a long while

i first gotta learn the basics of those classes and OOP
Thanx alot.
Posted: Sat Dec 03, 2005 7:07 pm
by foobar
ezSQL seems to be _exactly_ what you need.
Posted: Sat Dec 03, 2005 7:17 pm
by markg85
verry nice script... but it doesn`t even have fetch_array (the one i use ALOT) so another script maybe?
But thanx for the fast reply anyway

Posted: Sat Dec 03, 2005 7:20 pm
by foobar
markg85 wrote:verry nice script... but it doesn`t even have fetch_array (the one i use ALOT) so another script maybe?
But thanx for the fast reply anyway

Why not read the documentation? The name of the function is different, that's all.
Posted: Sat Dec 03, 2005 7:22 pm
by John Cartwright
Note, they required your email address to get the class
I would suggest Adodb, may take a little getting used to but it is
definantly worth it
Posted: Sat Dec 03, 2005 7:23 pm
by markg85
foobar wrote:markg85 wrote:verry nice script... but it doesn`t even have fetch_array (the one i use ALOT) so another script maybe?
But thanx for the fast reply anyway

Why not read the documentation? The name of the function is different, that's all.
oh well i did a search in ez_sql.php (mysql directory) and it couldn`t find a fetch_array whitch you really need for fetching arrays so that`s why i tought it isn`t in.. but i will read the docs

though i don`t think it`s in if they don`t use fetch_array
Posted: Sat Dec 03, 2005 7:27 pm
by foobar
Jcart wrote:Note, they required your email address to get the class
I would suggest Adodb, may take a little getting used to but it is
definantly worth it
Apparently they delete it afterwards. I suppose it's to prevent bots from downloading. But then again, someone could sign up once and then let the bots do their job. On a second thought, using bots for mass download does seem like a stupid idea in the first place. Oh well, geekissues uses ezSQL, so why not. I haven't received any spam from them yet, so I'm happy.
markg85 wrote:foobar wrote:markg85 wrote:verry nice script... but it doesn`t even have fetch_array (the one i use ALOT) so another script maybe?
But thanx for the fast reply anyway

Why not read the documentation? The name of the function is different, that's all.
oh well i did a search in ez_sql.php (mysql directory) and it couldn`t find a fetch_array whitch you really need for fetching arrays so that`s why i tought it isn`t in.. but i will read the docs

though i don`t think it`s in if they don`t use fetch_array
Allright, smartypants. There's a selection of functions similar to fetch_array : get_results, get_row, get_var, get_col. There, that's all of 'em. If you use a *good* PHP editor it should show you the parameters for each when you type $db->. Have fun.
Posted: Sat Dec 03, 2005 7:30 pm
by John Cartwright
//offtopic
haven't received any spam from them yet, so I'm happy.
Perhaps not directly from them

Posted: Sat Dec 03, 2005 7:31 pm
by foobar
Jcart wrote://offtopic
haven't received any spam from them yet, so I'm happy.
Perhaps not directly from them


You mean it was them who sold my address to Penis Enlargement Pharmaceuticals Inc. ?!!! I never knew...

Re: understandable MySQL Class(es)
Posted: Sat Dec 03, 2005 9:39 pm
by AKA Panama Jack
markg85 wrote:Hello,
i was just looking for a nice good mysql class with alot of options so if possibloe all mysql_* functions.
I found a few scripts who where good enough but what i really miss is a clear documentation of how to use that class.. i`m just new in classes and i don`t know exactly how it`s working but some classes really don`t make it easy
So here`s my question do you guys have/or know where to get a class that has the following:
all or atleast the most used mysql_* functions
a functions to show the total query usage
and a easy to use class... easy is this:
$db->fetch_array("SELECT * FROM bla bla bla.............."); <-- that`s the usage in scripts!!
and something like this to display the total query usage: $db->totals(); or something like it...
any help would be fine
i could make my own class but it would take me a long while

i first gotta learn the basics of those classes and OOP
Thanx alot.
ADOdb Lite
The link is in my signature and I wrote it.

It's very small and tight coding and uses most of the functions you are talking about. It's kind of a smaller, faster replacement for ADOdb.
If you try to learn OOP from ADOdb then expect your ears to bleed.

It is much more convoluted than it really needs to be and it shows in it's low performance (speed and CPU usage).
Posted: Sun Dec 04, 2005 1:56 am
by John Cartwright
AKA Panama Jack: Ah, good point.
Have a read
viewtopic.php?t=40805 and decide for yourself

Posted: Sun Dec 04, 2005 2:48 am
by AKA Panama Jack
Heh heh, I read it, heck I posted in it.

I have learned alot about how the different databases work in the past 6 months from detailed testing.

Plus some good tricks on how to keep OOP from becoming a memory hog.
Posted: Sun Dec 04, 2005 2:59 am
by matthijs
A while ago I was looking for db classes as well, and I did give ezsql a try. My experience is that it is a very easy to use and complete class, with good documentation. Th download comes with full examples how to use it. Also, I think wordpress is using something based on ezsql:
http://codex.wordpress.org/Function_Ref ... wpdb_Class
So I think it's safe to say that ezsql is a usefull and good db class. Maybe there are better ones, but I would certainly give it a try. It all depends on your needs I think.
Posted: Sun Dec 04, 2005 6:19 am
by jmut
So what is wrong with using PEAR :: DB ?
Posted: Sun Dec 04, 2005 12:32 pm
by AKA Panama Jack
jmut wrote:So what is wrong with using PEAR :: DB ?
Nothing other than it being very, very slow.