I need to print out an array, and also retrieve 1 value from this array, for two purposes. I need to get back up to the parent category by pulling out the parent id, but I also need to display all of the contents of that table. Basically the logic flows like so. Also I have tried differnt ways that I know of, and one way works but doesnt give the first item in the list.
$array - one value
while ($array =(sqlresult)) {
Listng;
}
heres the actual code
$id;
$list_subcategory = "";
$show_breadcrumb = "";
$sql = "SELECT FROM collections WHERE parent_id = $id ORDER BY sort_order ASC";
$result = mysql_query($sql);
//$bc = mysql_fetch_array($result);
while ($subcategory = mysql_fetch_array($result)) {
$list_subcategory .= "<font face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\"><a href=test3.php?id=".$subcategory["collection_id"].">".$subcategory["collection_name"]."</font></a><br><br>";
}
$par_id = $bc["parent_id"];
$sql2 = "SELECT FROM categories WHERE id = $par_id";
$result2 = mysql_query($sql2);
$breadcrumb = mysql_fetch_array($result2);
$show_breadcrumb = "<font face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\"><a href=test.php>products</a> : ".strtolower ($breadcrumb["cat_name"])."</font><br><br>";