Invalid argument supplied
Ik krijg de volgende foetmeldingen:
Warning: Invalid argument supplied for foreach() in C:\wamp\www\cafehofland\dchofland\adressenlijst\opvragen.php on line 7
Warning: Invalid argument supplied for foreach() in C:\wamp\www\cafehofland\dchofland\adressenlijst\opvragen.php on line 20
komt dit omdat het misschien PHP4 is en niet werkt in PHP5 ? en wat is dan wel de juiste code
Warning: Invalid argument supplied for foreach() in C:\wamp\www\cafehofland\dchofland\adressenlijst\opvragen.php on line 7
Warning: Invalid argument supplied for foreach() in C:\wamp\www\cafehofland\dchofland\adressenlijst\opvragen.php on line 20
komt dit omdat het misschien PHP4 is en niet werkt in PHP5 ? en wat is dan wel de juiste code
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
echo '</table>';
$row=mysql_fetch_row($res);
for($i=0;$i<$aantal_lijnen;$i++) {
$row=mysql_fetch_row($res);
foreach($row as $col) {
echo "$col";
}
}
echo "<br><br>";
echo '<table border=2 celpadding=2 width="100%">';
for($i=0;$i<$aantal_velden;$i++) {
printf("<th>%s</th>",mysql_field_name($res,$i));
}
for($i=0;$i<$aantal_lijnen;$i++) {
$row=mysql_fetch_row($res);
echo '<tr>';
foreach($row as $col) {
if(!$col) $col=" ";
echo "<td>$col</td>";
}
echo "</tr>";
}
echo "</table>";
$row=mysql_fetch_row($res);
for($i=0;$i<$aantal_lijnen;$i++) {
$row=mysql_fetch_row($res);
foreach($row as $col) {
echo "$col";
}
}
echo "<br><br>";
echo '<table border=2 celpadding=2 width="100%">';
for($i=0;$i<$aantal_velden;$i++) {
printf("<th>%s</th>",mysql_field_name($res,$i));
}
for($i=0;$i<$aantal_lijnen;$i++) {
$row=mysql_fetch_row($res);
echo '<tr>';
foreach($row as $col) {
if(!$col) $col=" ";
echo "<td>$col</td>";
}
echo "</tr>";
}
echo "</table>";
Gewijzigd op 01/01/1970 01:00:00 door Niek Kasius
Gesponsorde koppelingen:
EDIT:
zoiets zegmaar:
zoiets zegmaar:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
$query = "SELECT field1, field2, field3 FROM table";
if(!$result = mysql_query){
trigger_error(mysql_error());
}
else{
$field1Array = array();
$field2Array = array();
$field3Array = array();
while($rows = mysql_fetch_assoc($result)){
$field1Array[] = $rows['field1'];
$field2Array[] = $rows['field2'];
$field3Array[] = $rows['field3'];
}
for($i = 0;$i <= count($field1Array);$i++){
echo $field1Array[$i].'<br />';
echo $field2Array[$i].'<br />';
echo $field3Array[$i];
}
?>
$query = "SELECT field1, field2, field3 FROM table";
if(!$result = mysql_query){
trigger_error(mysql_error());
}
else{
$field1Array = array();
$field2Array = array();
$field3Array = array();
while($rows = mysql_fetch_assoc($result)){
$field1Array[] = $rows['field1'];
$field2Array[] = $rows['field2'];
$field3Array[] = $rows['field3'];
}
for($i = 0;$i <= count($field1Array);$i++){
echo $field1Array[$i].'<br />';
echo $field2Array[$i].'<br />';
echo $field3Array[$i];
}
?>
Gewijzigd op 01/01/1970 01:00:00 door Afra ca



