Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 99,785 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,553 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



i wanna mimic mysql_query function in php

 
Reply to this topicStart new topic

i wanna mimic mysql_query function in php

muster_1978
post 5 May, 2008 - 01:09 AM
Post #1


New D.I.C Head

*
Joined: 5 May, 2008
Posts: 2

Hi Everybody!!!

I have done loads & loads of searching on the net but couldn't find a solution for this.

I have a large bulky code of an application that has been around for years. It is built in PHP/MySql. Now the problem is that as the user database increased...the application slowed down. Now i have been assigned the task to find tune the application to make it faster.

I have parsed through the code and found that there is a function ExecuteSql which takes a query as an argument and then executes that query using mysql_query() function and then returns the result set obtained by running mysql_query().

What i m planning is if i can get the exact structure of the mysql resultset that is returned by executing the mysql_query() function...then i will save that in a flat file. Now whenever i encounter the same identical query again & again..i won't query the database server, instead i will load the result set saved in the flat file and then i will return that result set. In this way i hope that i will b able to make the application faster without doing much changes in this huge bulky code.

Can anybody help me on this?

Would greatly appreciate any help.

Thanks
Muster
User is offlineProfile CardPM

Go to the top of the page


joeyadms
post 5 May, 2008 - 02:35 AM
Post #2


D.I.C Head

Group Icon
Joined: 4 May, 2008
Posts: 145



Thanked 6 times

Dream Kudos: 600
My Contributions


What you want to do is caching.

If you look on google, there are some good tutorials on creating a cache engine for your php scripts. Basically, when a user visits a page, if it is in the cache and not too old, instead of querying the database or anything it will use the cache.

Also, I would recommend changing to the mysqli driver.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 7/25/08 01:28AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month
-->