Okay to start off this query we bigin with
PART1
$query = "select catid, catname from categories";
result=mysql_query($query);
simple enough
Part2.
then the result is passed to a function which follows
function db_result_to_array($result)
{
res array=array();
for ($count=0; row=@mysql_fetch_array($result); count++)
$res_array[$count]=$row;
return res_array;
}
Please explain part 2 in detail.
I do not understand the for statement or the $res_array [$count] = $row.
I have researched this but it is the only code that troubles me. The code works just fine I just don't understand it
Then Part 3.
$cat_array=$res_array
for each ($cat_array as $row)
{
$url="show_cat.php?catid=".($row["catid"]);
$title = $row["catname"];
echo "<li>;
do_html_url($url, $title);
}
I will betterunderstand Part3 if I can understand part 2.
Please explain part 2