netxm Posted September 5, 2009 Share Posted September 5, 2009 Hi, I'm new here and don't if it's right category to post... I need to create page on website fezayarns.com which will display a list of products (thumbnails, you can organize them by name or category). When you click on thumbnail, separate page will open with full description of product. There will be about 200-400 items and new will be added every month. I was thinking about php+mysql... Just give me an idea where to start. (php, javascript....) Thank you. Link to comment https://forums.phpfreaks.com/topic/173275-how-can-i-make-this/ Share on other sites More sharing options...
kratsg Posted September 6, 2009 Share Posted September 6, 2009 1.) Create database tables to store the product information (MySQL) 2.) Create code to query the tables to retrieve information and display on page (PHP+MySQL) 3.) Each thumbnail will contain code that produces a pop-up window (IE: view.php?pid=###) which displays the product information (PHP+MySQL+JavaScript) A basic layout of your PHP code: if(!mysql_num_rows($products = mysql_query("SELECT `pid`,`image`,`name` FROM `products`"))){ //error message stating there are no products to display } else { while($row = mysql_fetch_array($products)){ //echo html using $row['pid'], $row['image'], $row['name'] that displays a thumbnail, inserts javascript for viewing page } } And then for the pop-up page: if(!isset($_GET['pid']) || empty($_GET['pid']) || !is_numeric($_GET['pid'])){ //display error message saying that the pid is invalid or doesn't exist } else { $pid = (int)$_GET['pid'];//make it an int :-o } if(!mysql_num_rows($product = mysql_query("SELECT `name`,`image` FROM `products` WHERE `pid` = ".mysql_real_escape_string($pid)." LIMIT 1))){ //error message saying that the product does not exist } else { $row = mysql_fetch_array($product); } //$row['name'],$row['image'], etc.. now contains the details for the selected product. Just a quick, simple, basic outline. Link to comment https://forums.phpfreaks.com/topic/173275-how-can-i-make-this/#findComment-913384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.