Hi,
I am currently creating a website for my wife to sell some of her knitting/crotchet items. I have created an admin section which includes pages to list all the products that are available online or offline.
At the moment I have three separate pages for listing these pages
All products
Online products and
Off line products
I use this code for the offline products page
mysql_select_db($database_connBIW, $connBIW);
$query_rsProducts = "SELECT * FROM biw_product WHERE productonline = 'n' ORDER BY productid ASC";
$query_limit_rsProducts = sprintf("%s LIMIT %d, %d", $query_rsProducts, $startRow_rsProducts, $maxRows_rsProducts);
$rsProducts = mysql_query($query_limit_rsProducts, $connBIW) or die(mysql_error());
$row_rsProducts = mysql_fetch_assoc($rsProducts);
For the online page I have
mysql_select_db($database_connBIW, $connBIW);
$query_rsProducts = "SELECT * FROM biw_product WHERE productonline = 'y' ORDER BY productid ASC";
$query_limit_rsProducts = sprintf("%s LIMIT %d, %d", $query_rsProducts, $startRow_rsProducts, $maxRows_rsProducts);
$rsProducts = mysql_query($query_limit_rsProducts, $connBIW) or die(mysql_error());
$row_rsProducts = mysql_fetch_assoc($rsProducts);
To show all products I have this
mysql_select_db($database_connBIW, $connBIW);
$query_rsProducts = "SELECT * FROM biw_product ORDER BY productid ASC";
$query_limit_rsProducts = sprintf("%s LIMIT %d, %d", $query_rsProducts, $startRow_rsProducts, $maxRows_rsProducts);
$rsProducts = mysql_query($query_limit_rsProducts, $connBIW) or die(mysql_error());
$row_rsProducts = mysql_fetch_assoc($rsProducts);
Now even though all these work, I want to just use one page to display the information, with a selection box to choose between the three outputs, All, Offline or Online.
Could anyone point me in the right direction?
Regards,
Phil