understandable MySQL Class(es)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

markg85
Forum Commoner
Posts: 32
Joined: Sat Dec 03, 2005 6:49 pm

understandable MySQL Class(es)

Post 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 :P

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 :P i first gotta learn the basics of those classes and OOP

Thanx alot.
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

ezSQL seems to be _exactly_ what you need.
markg85
Forum Commoner
Posts: 32
Joined: Sat Dec 03, 2005 6:49 pm

Post 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 :D
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post 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 :D
Why not read the documentation? The name of the function is different, that's all.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Note, they required your email address to get the class :evil:

I would suggest Adodb, may take a little getting used to but it is definantly worth it
Last edited by John Cartwright on Sat Dec 03, 2005 7:23 pm, edited 1 time in total.
markg85
Forum Commoner
Posts: 32
Joined: Sat Dec 03, 2005 6:49 pm

Post 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 :D
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
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Jcart wrote:Note, they required your email address to get the class :evil:

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 :D
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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

//offtopic
haven't received any spam from them yet, so I'm happy.
Perhaps not directly from them :wink:
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Jcart wrote://offtopic
haven't received any spam from them yet, so I'm happy.
Perhaps not directly from them :wink:
:shock: You mean it was them who sold my address to Penis Enlargement Pharmaceuticals Inc. ?!!! I never knew... :lol:
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Re: understandable MySQL Class(es)

Post 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 :P

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 :P 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).
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

AKA Panama Jack: Ah, good point.

Have a read viewtopic.php?t=40805 and decide for yourself ;)
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Jcart wrote:AKA Panama Jack: Ah, good point.

Have a read viewtopic.php?t=40805 and decide for yourself ;)
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.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post 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
WordPress provides a class of functions for all database manipulations. The class is called wpdb and is based on the ezSQL (http://www.jvmultimedia.com/home/articl ... rticleId=2) class written and maintained by Justin Vincent (http://www.jvmultimedia.com). Though the WordPress class is slightly different than the ezSQL class, their use is essentially the same. Please see the ezSQL documentation (http://justinvincent.com/home/docs/ezsq ... l_help.htm) for more information.
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.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

So what is wrong with using PEAR :: DB ?
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

jmut wrote:So what is wrong with using PEAR :: DB ?
Nothing other than it being very, very slow.
Post Reply