Topic: PHP help?
Totage's photo
Tue 05/04/10 12:48 AM
I have a website I wrote in PHP.

I have blocks of content that I have placed in arrays to randomly rotate. I have litterally hundereds of links, images, and videos inside each array. The site is pretty slow becuase of all of the arrays being loaded at once.

I was thinking of maybe placing each array in a function in seperate files, then calling each function to load the content where I want it.

I was also thinking that it would probably be better to create a mySQL database and get what I want randomly that way.

My problem is that I have tons of links, images, and videos, so if I had to add each line individually, I would never be able to get it done.

I need to be able to c&p each array into something that will work much better. Any ideas?

Tessa02's photo
Tue 05/04/10 02:03 PM
Can't you use something like microsoft office to automatically seperate the links, images, etc & merge them together? I'm not real sure what it is you're doing. Because I'm not a whiz with codes. Only a little html coding. But, I've organized files that way that would otherwise take forever to separate.

Totage's photo
Wed 05/05/10 10:25 PM
I don't have Office. I don't think it would help me though. My site is written in PHP not HTML. I need the content to rotate randomly.

chrish's photo
Fri 05/07/10 11:50 AM
Why not create a database, then just loop through your array inserting the rows, you only need to do it once but it shouldn't take more than three minutes to write...

Totage's photo
Fri 05/07/10 09:53 PM
I think that's something like what I was thinking, but it's going to take me more than three minutes. :)

I just need to figure out how to do that.