Jump to content

studentict

New Members
  • Posts

    4
  • Joined

  • Last visited

studentict's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I just added a space at line 7, in front of WHERE, but now it doesn't read my data in a table
  2. The error is now solved but it doesn't read the data in a table, can you someone see what's miss with my table? From line 38 till 47?
  3. I'm sorry, that was the wrong error, this is the one of this file which i'm having trouble with : Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\www\evenementen.php on line 38
  4. Hi everyone, I'm studying ICT in Belgium and we have the task to design a website. So I'm working on a website for like parties, events and stuff. So I wrote the following code : <?php $link = mysqli_connect("localhost","root","","partyguide") or die ('Er ging iets mis: ' . mysqli_connect_error($link)); $sql = "SELECT * FROM evenementen"; if(!empty($_POST)) { $sql.="WHERE id='" .$_POST["evenement_datum"]."'"; } $result = mysqli_query($link,$sql); ?> <html> <head> <title>Evenementen</title> </head> <body> <?php if(empty($_POST)) { $link = mysqli_connect("localhost","root","","partyguide") or die ('Er ging iets mis: ' . mysqli_connect_error($link)); ?> <form name="form1" action="<?php echo($_SERVER["PHP_SELF"]);?>" method="post"> Kies een datum : <select name="evenement_datum"> <?php while($rij = mysqli_fetch_array($result)){ echo("<option value=\"".$rij['datum']."\">".$rij['datum']."</option>\n"); }?> </select> <input type="Submit" value="Toon evenementen!"> </form> <?php }else{ ?> <table width="1000" height="500" align="center" border="1" bordercolor="blue"> <?php while($rij = mysqli_fetch_array($result)){ ?> <tr> <td><?php echo $rij['datum']; ?></td> <td><?php echo $rij['plaats']; ?></td> <td><?php echo $rij['tijdstip']; ?></td> <td><?php echo $rij['naam'] ?></td> </tr> <?php } ?> </table> <?php } ?> </body> </html> So I'm trying to have an option box which displays the date's of events in my database, If i click a date, it has to display all the events in a table, but whenever I click one, following error pops up : Catchable fatal error: Object of class mysqli_result could not be converted to string in D:\www\evenementen.php on line 11 Can anyone help me with this? My teacher doesn't know how to solve this so I hope anyone of you could...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.