<?php
include("inc_db.php");
// $query = "select * from user where id=".$_SESSION["id"];
// echo $query1; die();
$result = $conn->query($query1);
if ($result->num_rows > 0)
{
echo '<p>Tasks record:</p>';
$row = $result->fetch_array(MYSQLI_ASSOC);
$t = $row['tasks'];
}
$result->free();
$conn->close();
?>
<div id="disp"></div>
<script>
j = <?php echo $t ?>; // This bring a JSON object not as a string !!! but as JSON
str = "";
for (i=0;i<j.tasks.length;i++)
str += j.tasks[i].description+"<br>";
document.getElementById("disp").innerHTML = str;
</script>