tags:

views:

88

answers:

1

I am a PHP Developer please help me ,i have problem to generate a dynamic menu to fetch data from database and store result in the dynamic array.

A: 

Arrays are dynamic by default in PHP, just add more items to it. As shown in this example (assuming the database is MYSQL):

$result = mysql_query(...);
$menu_array = array();
$i = 0;
while($row = mysql_fetch_array($result))
{
    $menu_array[$i] = $row['menu'];
    $i++;
}

Now $menu_array contains all the menu elements you fetched from the database.

Veger