Skip to main content
2 de 2
se eliminaron 10 caracteres en el cuerpo

tengo un problema con mysqli query

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\Users\Tommy\Desktop\test\SERVER\htdocs\test\a1\Database\db_connection.php on line 2897

function __construct(){
           $hostname = "localhost";
            $username = "root";
            $password = "";
            $dbname = "t4_new";

            // Create connection
            $con = new mysqli($hostname, $username, $password, $dbname);

            // Check connection
            if ($con->connect_error) {
               die("Connection failed: " . $con->connect_error);
            }




function getOwnArtefactInfoByType($vref, $type) {
                global $con;
                $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vref AND type = $type order by size";
                $result = mysqli_query($con,$q); //error aqui
                return mysqli_fetch_array($result);
            }