SHOW:
|
|
- or go back to the newest paste.
| 1 | <div class="gaestebog-chat"> | |
| 2 | <?php | |
| 3 | $sql = "SELECT id, name, email, massage, date | |
| 4 | - | FROM guestbook |
| 4 | + | FROM guestbook |
| 5 | - | ORDER bY id |
| 5 | + | ORDER bY id |
| 6 | - | DESC"; |
| 6 | + | DESC"; |
| 7 | ||
| 8 | $query = $objCon->query($sql); | |
| 9 | ||
| 10 | if($query->num_rows != 0){
| |
| 11 | echo '<hr>'; | |
| 12 | ||
| 13 | ||
| 14 | while($row = $query->fetch_object()){
| |
| 15 | $id = $row->id; | |
| 16 | $name = $row->name; | |
| 17 | $email = $row->email; | |
| 18 | $message = $row->message; | |
| 19 | $date = $row->date; | |
| 20 | ||
| 21 | $message = nl2br($message); | |
| 22 | ||
| 23 | echo '<div> | |
| 24 | - | Af <b>$name</b> - <b>date</b><br>' . |
| 24 | + | Af <b>$name</b> - <b>date</b><br>' . |
| 25 | - | $message . |
| 25 | + | $message . |
| 26 | - | '</div><hr>'; |
| 26 | + | '</div><hr>'; |
| 27 | } | |
| 28 | } else {
| |
| 29 | echo 'Ingen data fundet'; | |
| 30 | } | |
| 31 | ?> | |
| 32 | </div> |