jont Posted January 4, 2010 Share Posted January 4, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/187068-creating-a-new-object-for-every-mysql-query/ Share on other sites More sharing options...
oni-kun Posted January 4, 2010 Share Posted January 4, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/187068-creating-a-new-object-for-every-mysql-query/#findComment-987868 Share on other sites More sharing options...
ignace Posted January 4, 2010 Share Posted January 4, 2010 Keep everything in one thread http://www.phpfreaks.com/forums/index.php/topic,282176.msg1339126.html#msg1339126 Quote Link to comment https://forums.phpfreaks.com/topic/187068-creating-a-new-object-for-every-mysql-query/#findComment-988140 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.