-2

Why do I get this error when using :

mysqli_report ( MYSQLI_REPORT_ALL ); ? Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'No index used in query/prepared statement SELECT * FROM con_users LIMIT 10' in D:\xampp\htdocs\cms\includes\class\db.class.php:31 Stack trace: #0 D:\xampp\htdocs\cms\includes\class\db.class.php(31): mysqli->query('SELECT * FROM c...') #1 D:\xampp\htdocs\cms\index.php(6): db->Execute('SELECT * FROM c...') #2 {main} thrown in D:\xampp\htdocs\cms\includes\class\db.class.php on line 31

<?php
$PageRequest = strtolower(basename($_SERVER['REQUEST_URI']));
$PageFile    = strtolower(basename(__FILE__));
if($PageRequest == $PageFile) {
    exit('<span style="position: relative; top: 20px; font-family: Arial,sans-serif; font-size: 14px; color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;"><b>Erro #01</b>: You do not have permission to access this file directly.</span>');
}

mysqli_report(MYSQLI_REPORT_ALL);

class db extends mysqli {
    private $conn;

    public function __construct() {
        $this->Connection();

        if(connection_aborted() == true) {
            $this->Connection();
        }
    }

    private function Connection() {
        try {
            global $Config;
            $this->conn = new mysqli($Config['mysql']['hostname'], $Config['mysql']['username'], $Config['mysql']['password'], $Config['mysql']['database'], $Config['mysql']['dataport']);
        } catch (Exception $error) {
            exit('<span style="position: relative; top: 20px; font-family: Arial,sans-serif; font-size: 14px; color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;"><b>Erro #03</b>:' . $error->getMessage(). '</span>');
        }
    }

    public function Execute($Query) {
        $execute = $this->conn->query($Query);

        if($execute == false) {
            exit('<span style="position: relative; top: 20px; font-family: Arial,sans-serif; font-size: 14px; color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;"><b>Erro #04</b>: Query not found <b> "'.$Query.'"</b></span>');
        }


        return $execute;
    }

    public function NumRows($Query) {
        return mysqli_num_rows($Query);
    }

    public function FetchArray($Query) {
        return mysqli_fetch_array($Query);
    }

    public function FetchRow($Query) {
        return mysqli_fetch_row($Query);
    }
}

Codigo adicionado

1 Answers1

0

Open the php.ini, the extension = php.pdo.dll in front of the semicolon, Restart the apache