I was coding a User database which calls an static method of find_all which calls an query method which in turn returns all the value of a database but i am finding trouble in d
Just read docs:
mixed
mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
You must change your arguments to
mysqli_query($this->connection, $sql)
When using mysqli
in a procedural style, the first argument to mysqli_query
must be a connection object
From the official documentation:
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
So you need to change the order of the arguments, $this->connection
goes first and $sql
goes second:
$result = mysqli_query($this->connection, $sql);