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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.