most of the keywords here are in norwegian
THIS RIGHT HERE IS THE THING IM HAVING PROBLEMS WITH
it wont display (not even the errors) its supposed to display "bilde" as background image in div boxes so that you upload pictures, but nothing pops up, not even the errors. would be nice if anyone could help me.
if i enable error reporting the site wont load
$sql = "SELECT bilde FROM meme";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<div class='box' style='background-image: url({$row[bilde]}); background-size: 100%; width: 90%; height: 35%;'></div>";
}
} else {
echo "0 results";
}
here is the insert into database line
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "mydb"; //her skriver du navn på databasen
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$bilde = $_REQUEST['bilde'];
$sql = "INSERT INTO meme (bilde) VALUES ('$bilde') ";
if(mysqli_query($conn, $sql)){
echo "Vellykket";
} else{
echo "ERROR: Det oppsto en feil <br> $sql. <br><br>";
echo mysqli_error($conn);
}
echo "<br><br><a href='memepage.php'>Tilbake</a>";
and lastly the form
<form action="insert.php">
<p class="link">Link her:</p> <br>
<input type="text" name="bilde"> <br>
<br>
<input type="submit" value="Fullfør" method="post">
it said that line 37 was the prob and thats line 37 – Kevin May 21 '18 at 23:08