php array help
Posted: Sat Dec 03, 2011 12:58 am
Array
(
[1] => Array
(
[id] => 2
[menu_name] => php
[type] => 2
[visible] => 1
)
guyz i have this array as output ...i want to change the code so that when i type id =2 the array should be
[2] =id
{
[menu_name] => php
[type] => 2
[visible] => 1
)
it should fetch from id =2 and give me the output ..please hlp sort of urgent
the code is <?php
$rs = mysql_query("select * from subject",$connection);
while( $ds = mysql_fetch_assoc($rs) )
{
$arrList[] = $ds;
}
echo '<pre>';
echo $arrList[2]['id'];///exit;
print_r($arrList);exit
/// help
(
[1] => Array
(
[id] => 2
[menu_name] => php
[type] => 2
[visible] => 1
)
guyz i have this array as output ...i want to change the code so that when i type id =2 the array should be
[2] =id
{
[menu_name] => php
[type] => 2
[visible] => 1
)
it should fetch from id =2 and give me the output ..please hlp sort of urgent
the code is <?php
$rs = mysql_query("select * from subject",$connection);
while( $ds = mysql_fetch_assoc($rs) )
{
$arrList[] = $ds;
}
echo '<pre>';
echo $arrList[2]['id'];///exit;
print_r($arrList);exit
/// help