So i've created a database on SQL, i'm trying to get information (id,title and date)out of one of the tables i need and make an html element of it but when i run the function nothing happens.
<?php
function getTitles (){
$conn;
$sql='SELECT * FROM `thumbnails`';
$statement = $conn->prepare($sql);
$statement->bindValue(":title_id",$title_id);
$statement->execute();
$titles = $statement->fetchAll();
$output='';
foreach($titles as $title) {
$output .='<div class="col-4 thumbnails"><img src="../stlye/images/art'.$title['id'].'.jpg" class="img-flexible">
<h2>'.$title['title'].'</h2>
<p class="time"><time>'.$title["date"].'</time></p></div>';
}
return $output;
}
?>