logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-23-2011, 04:01 PM   #1
m1a2x3x7
m1a2x3x7's Avatar
 
Join Date: Mar 2007
Posts: 297
Default Storing data in a tmpfile before querying a database

I'm trying to find the correct solution for my application. I'm wondering if creating a tmpfile is correct.

I'm collecting data (impressions and clicks) for items on a page. I don't want to query the database every time to page loads because there will be hundreds of impressions for every page load.

My thought was to store all the impressions in a tmp file, then every hour run a task or cron job from the server that then queries the database and distorys the tmpfile.

Am I going about this the right way? Or should I try something different?

Thanks.

-M
__________________
Chris Schultz
Web and Multimedia Designer
Schultz|Studio
m1a2x3x7 is offline   Reply With Quote
Old 08-30-2011, 12:12 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Why not store in a $_SESSION
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-30-2011, 12:52 PM   #3
m1a2x3x7
m1a2x3x7's Avatar
 
Join Date: Mar 2007
Posts: 297
Default

Hey David,

I'm wanting to store thousands of impressions from different users and only query the database onces every hour or so. I'm not seeing how a session would be of use in this situation since a session would be unique for a single user.
__________________
Chris Schultz
Web and Multimedia Designer
Schultz|Studio
m1a2x3x7 is offline   Reply With Quote
Old 08-30-2011, 01:10 PM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

I would probably use the database directly. I am sure it can handle it.

If you want to store to a temp file then I have a script knocking about somewhere I can send you
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-30-2011, 03:00 PM   #5
m1a2x3x7
m1a2x3x7's Avatar
 
Join Date: Mar 2007
Posts: 297
Default

That's OK. I can write something up no problem. I just wanted to if there was another way to go about it.
__________________
Chris Schultz
Web and Multimedia Designer
Schultz|Studio
m1a2x3x7 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com