Page 1 of 1

Too big an array?

Posted: Wed Mar 01, 2006 7:14 am
by php3ch0
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

Posted: Wed Mar 01, 2006 7:44 am
by Jenk
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.

Posted: Wed Mar 01, 2006 7:47 am
by php3ch0
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

Posted: Wed Mar 01, 2006 7:49 am
by Jenk
It's a lot to go into, but basically it comes down to using your tables instead of a mammoth array.

Posted: Wed Mar 01, 2006 7:51 am
by php3ch0
Do you know of any tutorials you could point me in the direction of?

Posted: Wed Mar 01, 2006 8:42 am
by Jenk
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.