You are mixing the object oriented and the procedural style when executing
mysqli functions. I suggest to choose only one style.
dbconnect.php uses the procedural style and assigns the object to
$con
.
In
user.php you are calling the query function in the object oriented style using the undefined
$mysqli
object:
$result = $mysqli->query( $query );
You must use the object returned from connecting instead:
$result = $con->query( $query );
or use the procedural style:
$result = mysqli_query( $con, $query );
See also the examples at
PHP: mysqli::query - Manual[
^].