PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
php3ch0
Forum Contributor
Posts: 212 Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK
Post
by php3ch0 » Wed Mar 01, 2006 7:14 am
I am writing a forum script and I want to use an array to store the users last visit to show what topics are new.
it would be in the format
$array[ topic id] -> [last visit]
from here I would check the date of the most recent post agains the users last forum visit array for that topic.
Would this array bcome too large and slow things down considerably.
Is there a better way to do this?
Thanks
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Wed Mar 01, 2006 7:44 am
Why do you need to store them in an array?
I don't know if there is a hardlimit to how big an array can be, but it's best to avoid using them for such large functionality.
php3ch0
Forum Contributor
Posts: 212 Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK
Post
by php3ch0 » Wed Mar 01, 2006 7:47 am
I dont need to use an array but would like suggestions on how to do this better.
It would be good to show new posts in top level category and sub categories updated as soon as the user has clicked on the category.
Dan
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Wed Mar 01, 2006 7:49 am
It's a lot to go into, but basically it comes down to using your tables instead of a mammoth array.
php3ch0
Forum Contributor
Posts: 212 Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK
Post
by php3ch0 » Wed Mar 01, 2006 7:51 am
Do you know of any tutorials you could point me in the direction of?
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Wed Mar 01, 2006 8:42 am
There is a tutorial for making a forum, I've seen someone post it on these boards. I'm sure Google would find in no time, I don't have a link off the top of my head, sorry.