The online racing simulator
PHP help/suggestions needed
(4 posts, started )
PHP help/suggestions needed
Hey all,

Working on a new website for my Mum's shop (http://designsonpine.co.uk). Re-coding the way some of it works, especially the page layouts. The website is PHP + MySQL driven.

As you can see in the attached image there is a row of images and then the product info.

The way my old code worked was take everything out of the database and store it in arrays i.e:

Itemcode[a]
Image_ID[a]
etc

Then I'd loop through it and populate the first <tr> with the images and work my way down with item codes etc. Doing it this way I ended up with loads of whiles and ifs.

This seems a very clumber some way to do it and was wandering whether anyone had any other suggestions that I'm just not seeing.

As I'm making some major changes just wanted to see if anyone had any suggestions before I started getting my head around my current mess

Keiran
Attached images
web.png
Use a goddamn templating system, like smarty. This effectively means, don't change it from how you're doing things, as you'll have to pass all the data to a templating engine, in an array

Nice site and products though
Templating is secondend. If you don't like the complexity of Smarty and want something even simpler (which I use for small projects at times), go and search for "Phemplate"... a simple Google search will turn it up.

Also use caching, you'll save yourself a hell of a lot of overhead as far as server load goes. Just update the cache every so often, or when a new product is added to the catalogue
Thanks for the suggestions guys. Looking into the templating but need to get my head around them, smarty confused the hell out of me!

Deffo looking into caching the product pages

PHP help/suggestions needed
(4 posts, started )
FGED GREDG RDFGDR GSFDG