Jump to content


Photo

Preloading mysql results


  • Please log in to reply
2 replies to this topic

#1 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 12 June 2006 - 04:15 PM

I don't usually ask questions but this is kind of a "wondering".

I have a script which loads different pages and remembers the history of the loaded pages by using cookies in the form of tabs. Now at the moment this script saves only the link to each page and each page has to reload itself again (each page contains data from a DB) which is not too fast and makes the tabs a bit untabish. Now what I'm thinking is about preloading the $result for each window query in the php, and then transferring those to javascript, and then playing around with the windows in javascript.

What do you think? On the one hand I don't know if it's good to preload about 6 queries with about 20 rows each (about 1k per row)

Any ideas or advice from someone with a lot of background in coding?

Thanks in advance for any feedback.
z..z..z..z..z..z..z..z..

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 12 June 2006 - 04:22 PM

well there is always storing the results as sessions but for all intents and purposes that probably just as slow from the user's POV i think. I think JSing it would probably be your best solution. I mean, 20 rows at 1k * 6 is 120k. that's not really a whole lot of waiting even on dialup speed. I think it would be better for the one time wait than having your site be slow overall, right?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 13 June 2006 - 07:35 AM

suppose so, at any rate I'm looking for ways to move loops which output html from php to javascript to reduce the strain on my server and the bandwidth in use.
z..z..z..z..z..z..z..z..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users