In my code, in PHPSTORM it returns that method fetch_all
was not found.
<?php
$conn = require 'connection.php';
$result = $conn->query('SELECT * FROM users');
$users = $result->fetch_all(MYSQLI_ASSOC);
?>
As I've just started, this is still the only code on the page outside HTML.
And this is the error it shows in the browser:
Fatal error: Uncaught Error: Call to a member function query() on integer in C:\Users\Administrador\Documents\estudosphp\crud\index.php:4
Code of the connection.php page:
$conn = new mysqli('localhost', 'root', '', 'php_mysql');
if($conn-> connect_errno){
die('falhou a conexão ('. $conn -> connect_errno .')' . $conn->connect_error);
}