I am trying to get this to echo out from the database and I know there is a problem but I don’t know if it is not getting the information or if I am doing a wrong way getting it to echo it out I am new to using PDO.
<?php
include 'add/dbconnect.php';
function getfevent ($conn) {
$sql = "SELECT `name` FROM `event` WHERE `featured` = 0 LIMIT 0, 30 ";
foreach ($conn->query($sql) as $row) {
echo $row['name'];
}
}
?>
Try something like this (not tested).