Lid |
|
Hallo iedereen, ik ben bezig met mijn site...
de gegevens worden uit de database gehaald maar ik krijg nu ineens een fout...
//maakt vervinding:
<?php
include("config/connect.php");
$id = $_GET['id'];
$select1 = mysql_query(" SELECT * FROM menu ORDER BY id");
$select2 = mysql_query(" SELECT * FROM index WHERE id='". $id ."'");
$select3 = mysql_query(" SELECT * FROM menu2 ORDER BY id");
?>
<?php include("config/connect.php"); $id = $_GET['id']; $select1 = mysql_query(" SELECT * FROM menu ORDER BY id"); $select2 = mysql_query(" SELECT * FROM index WHERE id='". $id ."'"); $select3 = mysql_query(" SELECT * FROM menu2 ORDER BY id"); ?>
//menu 1 (doet het goed)
<?
while($obj = mysql_fetch_object($select1)) {
echo " <table>". $obj->menu ."</table>";
}
?>
<? echo " <table>". $obj->menu ."</table>"; } ?>
//index doet het niet:
<?
while($obj2 = mysql_fetch_object($select2)) {
echo " <table>". $obj2->tekst ."</table>";
}
?>
<? echo " <table>". $obj2->tekst ."</table>"; } ?>
fout: Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/index.php on line 54 (op lijn 54 staat: while($obj2 = mysql_fetch_object($select2)) {)
//menu 2 doet het goed:
<?
while($obj3 = mysql_fetch_object($select3)) {
echo " <table>". $obj3->menu ."</table>";
}
?>
<? echo " <table>". $obj3->menu ."</table>"; } ?>
|