Hi all I am trying to display products dependent on the genre that is selected!
For example product page contains four genre’s.
ALL MUSIC
ROCK
ROMANCE
SCRUMPY AND WESTERN
From the above I want to link these to a products page which displays only them products selected from the genre!
Here is my code!
[php]
<? session_start(); ?> <?php require_once 'include/db_config.php'; $sql="SELECT * FROM products"; $result=mysql_query($sql); $genre=$_GET['genre']; echo '- ';
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
if ($row["genre"]==$genre||$genre=="all"){
echo '
- ';
echo ''; echo ''; echo '
'.$row["title"].'
'; echo ''.$row["artist"].''; echo '
'; echo ''.'£'.$row["price"].' - '.'Buy'; echo ''; echo ''; echo ''; echo '
';
}}
echo '
[/php]
I’m a newbie and don’t have a clue what im doing wrong. Thanks in advance.
Sorry if I have placed the code in wrong first time!