Jump to content

Creating a new object for every mysql query?


jont

Recommended Posts

Is there anything wrong with creating a new object for every mysql query in my scripts?

 

Basicly I have 5 main mysql classes dbConnect, dbSelect, dbInsert, dbUpdate and dbDelete.

 

dbConnect does the obvious then each time im making a new query to the database I'm creating a new object. I've found this fairly helpfull but are there any drawbacks or disadvantages to it?

Is there anything wrong with creating a new object for every mysql query in my scripts?

 

Basicly I have 5 main mysql classes dbConnect, dbSelect, dbInsert, dbUpdate and dbDelete.

 

dbConnect does the obvious then each time im making a new query to the database I'm creating a new object. I've found this fairly helpfull but are there any drawbacks or disadvantages to it?

 

What is the point of aliasing commands? If you've long queries that would be helpful for you to split into functions that'd be fine, but if you're just going to use a simple query per each one it'd be as pointless in the first place as writing 'db*' down.

 

And to your question, Core functions are many times as fast than calling an object.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.