Re: [PHP] MySQL class. Thoughts?

2009-01-22 Thread clive
Chris wrote: That won't tell you where a query comes from ;) Add a debug_backtrace into the class to also pinpoint where the query was called from. Complicated queries built on variables (or even just long queries built over multiple lines) will be hard to find just by looking at the mysql

[PHP] MySQL class. Thoughts?

2009-01-21 Thread Jay Moore
This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. Thanks, Jay Class: -- ?php // Standard MySQL class class do_mysql {

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Edmund Hertle
2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. Thanks, Jay Hey, 1. You know the

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Kyle Terry
On Wed, Jan 21, 2009 at 9:45 AM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. Thanks, Jay Class:

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Richard Heyes
This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. I have a similar thing I use, which uses the same (or at least very similar) API

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Paul M Foster schreef: On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Philip Graham
On January 21, 2009 12:37:07 Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. I definetly think that using a DB

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jay Moore
Good ideas guys. The input is much appreciated. Jochem (and anyone else, I guess), as I am not 100% versed with Exceptions, the php5 version you suggested, are those Exceptions able to be handled outside the class? Do I need my try block to be within the class block, or can I have the try

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 09:10:54PM +0100, Jochem Maas wrote: Paul M Foster schreef: On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 02:30:00PM -0600, Jay Moore wrote: Good ideas guys. The input is much appreciated. Jochem (and anyone else, I guess), as I am not 100% versed with Exceptions, the php5 version you suggested, are those Exceptions able to be handled outside the class? Do I need my

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Jay Moore schreef: Good ideas guys. The input is much appreciated. Jochem (and anyone else, I guess), as I am not 100% versed with Exceptions, the php5 version you suggested, are those Exceptions able to be handled outside the class? Do I need my try block to be within the class block,

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jay Moore
I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all kinds of try/catch blocks around everything. They make for non-linear execution, and I

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Jay Moore schreef: I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all kinds of try/catch blocks around everything. They make for

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Török Alpár
2009/1/21 Jay Moore jaymo...@accu-com.com I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all kinds of try/catch blocks around

Re: Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread ceo
there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every function implemented and catch all the

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Nathan Rixham
c...@l-i-e.com wrote: there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every function implemented and

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 10:00:53PM +0100, Jochem Maas wrote: Jay Moore schreef: I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Nathan Rixham schreef: c...@l-i-e.com wrote: there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Chris
Eric Butera wrote: On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread ceo
I prefer to deal with the issues locally, or have a documented behaviour with return values and error details available, much like most of PHP extensions/internals. try/catch ends up with weird code organization, imho, especially when you can only really handle some exceptions. For real

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 5:53 PM, Chris dmag...@gmail.com wrote: Eric Butera wrote: On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Chris
Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class :) (I've done that before to check what's being run and where

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 6:09 PM, Chris dmag...@gmail.com wrote: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Chris schreef: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class :) (I've done that before to check what's being

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote: Chris schreef: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Ashley Sheridan
On Wed, 2009-01-21 at 18:52 -0500, Eric Butera wrote: On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote: Chris schreef: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 7:07 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Wed, 2009-01-21 at 18:52 -0500, Eric Butera wrote: On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote: Chris schreef: Yea if you're only targeting 1 db, then why not use that class?