If I use this code to get records from mysql
Then how can I apply different style to the clicked product, like if below code results:
product 1
product 2
product 3
And then if some one click on product 1, it should be like this:
product 1
product 2
product 3
I have tried with several things but have not succeeded yet. What is the best way to do this?
Thanks.
Code:
<ul> <?php $cquery = mysql_query ("Select * From product Where category_id=$category_id"); while ( $cr = mysql_fetch_array ($cquery)) { while ( $pr = mysql_fetch_array ($cquery) ) { ?> <li> <a href="index.php?product=<?php echo $category_id; ?>&product_id=<?php echo $pr['product_id']; ?>"><?php echo $pr['name']; ?></a> </li> <?php } } ?> </ul>
product 1
product 2
product 3
And then if some one click on product 1, it should be like this:
product 1
product 2
product 3
I have tried with several things but have not succeeded yet. What is the best way to do this?
Thanks.
Comment