Thursday, 30 August 2018
Subscribe to:
Post Comments (Atom)
$zavodnici_array = array();
while(false !== ($row = mysql_fetch_assoc($result))) {
$zavodnici_array[] = $row;
}
foreach($zavodnici_array as $key) {
echo $zavodnici_array[$key][id] ."<br>";
echo $zavodnici_array[$key][jmeno] ."<br>";
echo $zavodnici_array[$key][prijmeni] ."<br>";
}
foreach as $key
key is the value of each item in the array not the keymysql
query fetched resultsforeach($zavodnici_array as $key => $value) {
echo $zavodnici_array[$key]['id'] ."<br>";
echo $zavodnici_array[$key]['jmeno'] ."<br>";
echo $zavodnici_array[$key]['prijmeni'] ."<br>";
}
foreach($zavodnici_array as $value) {
echo $value['id'] ."<br>";
echo $value['jmeno'] ."<br>";
echo $value['prijmeni'] ."<br>";
}
$value[id]
is not valid. I assumed you were trying to type the index id
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment