...

View Full Version : echo out an array?



jarv
05-25-2011, 12:10 PM
Just wondering why I can't echo out an array? hmm




while($i=mysql_fetch_row($cur))
{$show_chamber[$show_newbookingscount]=$i[0];
$show_surgery[$show_newbookingscount]=$i[1];
$show_branch[$show_newbookingscount]=$i[2];
$show_sessiontype[$show_newbookingscount]=$i[3];
$show_datebooking[$show_newbookingscount]=$i[4];
$show_starttime[$show_newbookingscount]=substr($i[5],11,5);
$show_finishtime[$show_newbookingscount]=substr($i[6],11,5);
$show_increment[$show_newbookingscount]=$i[7];
$show_duration[$show_newbookingscount]=$i[8];
$show_cost[$show_newbookingscount]=$i[9];
$show_surgeryname[$show_newbookingscount]=$i[10];
$show_branchname[$show_newbookingscount]=$i[11];
$show_bookingtempid[$show_newbookingscount]=$i[12];
$show_newbookingscount++;
}

echo 'start time: '.$show_starttime[$show_newbookingscount].'<br />';

gvre
05-25-2011, 01:11 PM
Have you initialize somewhere the $show_newbookingscount variable?
ps. Use $i, $j, $k only for counters.

tangoforce
05-25-2011, 01:58 PM
You can't echo out an array - php will literally pass the value of 'array()' back to the server which is what you'll then see on the webpage.

Instead you can use var_dump($Array) or print_r($Array).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum