I have a problem with the connection to mysql. The following code I tried
route.comments.php
With this code comes only blank page. What am I doing wrong?
route.comments.php
PHP:
<?php
$route = function($handler) {
try {
// test id
$m_id = '2';
$db = DB::getInstance();
$db->query('SELECT * FROM '.DB::getTable('comments').' WHERE id_post=:m_id');
$db->bind(':m_id', $m_id);
$db_c = $db->fetchAll();
foreach($db_c as $db_a) {
echo $db_a['comment'];
}
} catch(Exception $e) {
G\exception_to_error($e);
}
};
?>
With this code comes only blank page. What am I doing wrong?