On Thu, 22 Feb 2001 02:11, Matt Williams wrote:
> I have done it this way...
>
>       $menu = array();
>       $count = $db->num_rows();
>       for($i = 0; $db->next_record(); $i++)
>       {
>               $menu[$i]["name"] = $db->f("name");
>               $menu[$i]["url"] = $db->f("topic_id");
>       }
>
> OK, so is there a better way of acheiving the same end result?
> and this is what I've got to print the results
>
>                       while ( list($name, $subarray) = each($menu) )
>
>
>                                       echo "<a
> href=\"".$subarray["url"]."\">".$subarray["name"]."<a><br>\n";
>
>                       }
>
> is there any better way of doing this??
>
> thanks
>
> M@

Why do you need to put the values in an array, then read through the 
array to print the values? Why not just print each record as you get it 
from the DB?

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to