• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

Help me: Mysql connection dont work

Status
Not open for further replies.

Valerius

Chevereto Member
I have a problem with the connection to mysql. The following code I tried

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?
 
Status
Not open for further replies.
Back
Top