PDA

View Full Version : navigation bar edit


swissbeets
06-30-2008, 12:45 AM
i am at the edit part of my website and am having a terrible time, what i want is the names of the products to be displayed and when i click on them it will bring up the edit_product page but for some reason my navigation bar is listing the products then below the products it lists only the first product and only this one can be clicked. once clicked it takes me to the edit_product page but it is still not lsiting the others...


thank you for any help



function navigation($sel_product, $public = false)
{
$output = "<ul class=\"products\">";
$product_set = get_all_products();
while ($product = mysql_fetch_array($product_set))
{
$output .= "<li";
if ($product["product_id"] == $sel_product['product_id']) { $output .= " class=\"products\""; }
$output .= "><a href=\"edit_product.php?prod=" . urlencode($product["product_id"]) .
"\">{$product["product_name"]}</a></li>";
$product_set = get_all_products();


while($row = mysql_fetch_array($product_set)){

echo $row['product_name']."<br />";

}


}
$output .= "</ul>";
return $output;
}

only other function called

function get_all_products($public = false)
{
global $connection;
$query = "SELECT *
FROM products ";
$product_set = mysql_query($query);
return $product_set;
confirm_query($product_set);

}

davidj
06-30-2008, 05:50 AM
where did you get this code from

who wrote this for you

swissbeets
06-30-2008, 02:06 PM
i got it working, i wrote it with the tutorial from lynda.com now i am adapting it to fit my website

davidj
06-30-2008, 03:26 PM
ok thats fine