Page 1 of 1

mysqli_query() expects at least 2 parameters, 1 given in

Posted: 29 Sep 2016, 00:38
by JanMolendijk
I hope you could help me out with this problem

Code: Select all

<?php
session_start();
include_once 'dbconnect.php';

if(!$mid){
$query = mysqli_query("SELECT * FROM users");
$result = mysqli_num_rows($query);
I getting two errors:

Code: Select all

Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/u790012824/public_html/Test/Log-In/profiel.php on line 11

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/u790012824/public_html/Test/Log-In/profiel.php on line 12

mysqli_query() expects at least 2 parameters, 1 given in

Posted: 29 Sep 2016, 05:35
by Admin
Hello
You have to the object with the mysqli connection:

Code: Select all

$query = $conn->query("...");
//OR:
$query = mysqli_query("...", $conn);