0

I have a function as follows:

function display_results() {
    $query = "SELECT *
            FROM comments WHERE id = 1";
    $result = mysqli_query($connection, $query);
    confirm_query($result);

    while ($row = mysqli_fetch_array($result)) {
        echo $row['comment'];
    }
}

In another file I include the function, and then call it:

<?php require_once($root . 'includes/ui_functions'); ?>
<?php display_results(); ?>

But it returns as "Database query failed", without any other information. This only happens since I switched from mysql_* to mysqli_* connection. The MySQL syntax is fine, it simply fails the database query no matter what I query it.

user1228907
  • 369
  • 2
  • 6
  • 16

0 Answers0