I have problem with outputing images from my mysql database (table)
I manage to store images into the table but when I try to output it I get some row code into browser.
Here is my output query:
<?php
$queri_goals = mysqli_query($conn, "SELECT*FROM goals WHERE user_id = {$user_id}");
while ($goal=mysqli_fetch_array($queri_goals)) {
$user_id2 = $goal['user_id'];
$goalname = $goal['goal'];
$description = $goal['description'];
$deadline = $goal['deadline'];
$image = $goal['image'];
echo "<tr>
<td>$user_id2</a></td>
<td>$goalname</td>
<td>$description</td>
<td>$deadline</td>
<td>$image</td></tr>";
} echo "</table>";
?>
input query:
$image =addslashes(file_get_contents($_FILES['goalupload']['tmp_name'])); //$_FILES -> globalna varijabla za filove, u prvu ['ide ime iz forme']['ide koji tip podatka npr name sto je u ovom slucaju upload']
$image_name = addslashes($_FILES['goalupload']['name']);
$image_size = getimagesize($_FILES['goalupload']['tmp_name']);
//Perform Query
mysqli_query($conn, "INSERT INTO goals (user_id, goal, description, deadline, image_name, image)
VALUES('{$user_id}','{$goalname}', '{$description}', '{$deadline}', '{$image_name}', '{$image}')");
echo " Your goal is successfully created";
images are stored like as a binary data BLOB into the table...
Thanks in advance! Denis