Hi,
I have a database of products but I am finding it diffult to understand how to categorise each product and build a site for it.
Can I do something like this:
$category = (
$gamesconsoles = ( playstation, xbox, wii )
$personalhygiene = ( electric toothbrush, electric razor, electric shaver)
)
So I have PHP code which identifies a 'Playstation' as a $gamesconsoles. It then enters a 'gamesconsoles' tag into the database in a category field.
I then I have link on my site which looks something like this on the homepage:
productrange.php?category="gamesconsoles" class="menulink">Games Consoles</a>
I then link to a productrange.php page which has in it:
$category = category;
if (isset($_GET['category'])) {
$id = $_GET['category'];
}
I then echo all the producys from the database which come under the category of 'gamesconsoles'.
Or am I completely mad and it should be done differently. If so please advise.



Reply With Quote



Bookmarks