"; echo ""; echo "Du måste vara inloggad för att favoritmarkera."; echo ""; echo "

"; include "right.php"; echo ""; include "bottom.php"; exit(); } $con=mysqli_connect("mysql16.citynetwork.se","113153-du15850","DX08!%fluff","113153-fodd"); $f = 0; $sql = "SELECT * FROM favoriter WHERE foddID = " . $_GET['ID'] . " AND userID = " . $_SESSION['asess_id']; echo $sql; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { $sql = "DELETE FROM favoriter WHERE foddID = " . $_GET['ID'] . " AND userID = " . $_SESSION['asess_id']; $f = 1; echo $sql; } if ($f == 0) { $result2 = mysqli_query($con,"SELECT * FROM favoriter ORDER BY ID DESC LIMIT 1"); while($row2 = mysqli_fetch_array($result2)) { $ID = $row2['ID']; } if ($ID=="") { $ID = 1; } else { $ID = $ID + 1; } $sql = "INSERT INTO favoriter (ID, userID, foddID, tidpunkt) VALUES (" . $ID . ", " . $_SESSION['asess_id'] . ", " . $_GET['ID'] . ", '" . date('Y-m-d H:i') . "')"; } echo $sql; $result = mysqli_query($con,$sql); $sokID = $foddID; include "sok.php"; echo "

"; include "right.php"; echo ""; include "bottom.php"; ?>