Jump to content

lunkan1245

New Members
  • Posts

    1
  • Joined

  • Last visited

lunkan1245's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Im trying to display my comments in i while loop thats inside another while loop but im getting an error and I looked through my code and i cant see whats wrong with it. Can someone plz help me to see were the problem is? The comments are still inserted into the database but is not shown. The error is the second while loop, this line while ( $rows = mysqli_fetch_array($results)) <?php //loopar igenom databasen för bilderna $query = "SELECT * FROM bilder"; $result = mysqli_query($dbc, $query); while ( $row = mysqli_fetch_array($result)) {?> <a href="bilder/<?php echo $row['namn'];?>" data-init="mbox" data-type="image" class="mbox"><img src="thumb_bilder/<?php echo $row['namn'] ;?>" width="300" height="200"/><span class="mbox-descr"><span class="information"> <?php echo $row['username'];?><br /> <?php echo $row['datum'];?><br /><br /> <?php echo $row['kommentar'];?><br /> <p style="border-bottom:1px solid grey; margin-top:80px; margin-bottom:30px;"></p> <?php echo $row['kamera'];?><br /><?php echo $row['objektiv'];?><br /> <p style="border-bottom:1px solid grey; margin-top:80px; margin-bottom:30px;"></p> <img src="img/slutartid.png" class="smabilder"/><?php echo $row['slutartid'];?><br /> <img src="img/blandare.png" class="smabilder"/><?php echo $row['blandare'];?><br /><img src="img/skarpdjup.png" class="smabilder"/> <span class="skarpdjup"><?php echo $row['skarpdjup'];?></span><br /> <img src="img/iso.png"/ class="smabilder"><?php echo $row['iso'];?> <form method="post" action="includes/insert.php" class="img_comment"><textarea name="kommentar" placeholder="comment" class="comment"></textarea><br /><input type="hidden" name="hidden" value="<?php echo $row['img_id']?>"/><input type="submit" name="submit" value="skicka" class="skicka"></form><div class="svar"><?php $value = (isset($_POST['hidden'])); $querys = "SELECT * FROM kommentarer where img_id = $value"; $results = mysqli_query($dbc, $querys) or die(mysqli_error($dbc)); while ( $rows = mysqli_fetch_array($results)) { $comment = $rows['kommentar']; $uppladdare = $rows['username']; echo $comment; echo "<br />"; echo $uppladdare; echo "<br />"; } ?></div></span></span></a> <?php } ?>
×
×
  • 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.