xxxxxxxxxx
For me, there was an error in my SQL query that was giving me this error. Check if the query that you are running works in your database management system!
xxxxxxxxxx
mysqli_fetch_array()'s 1st parameter must be a result of a query. What you are doing is you are passing the connection (which doesn't make sense) and the query command itself.
To fix this, execute the query first, then store the result to a variable then later fetch that variable.
$sql = "select * from privinsi";
$result = mysqli_query($connection,$sql);
while($r = mysqli_fetch_array($result))
{
// your code here
}
xxxxxxxxxx
$query=mysqli_query($con,"select tbluser.fld_name,tbluser.flduser_id,tbluser.fld_email,
tbluser.fld_mob,tbluser.fld_address,tbluser.fld_logo,tbfood.food_id,tbfood.foodname,tbfood.cost,
tbfood.cuisines,tbfood.paymentmode
from tbluser inner join tbfood on tbluser.flduser_id=tbfood.flduser_id;");
xxxxxxxxxx
$query=mysqli_query($con,"select tbluser.fld_name,tbluser.flduser_id,tbluser.fld_email,
tbluser.fld_mob,tbluser.fld_address,tbluser.fld_logo,tbfood.food_id,tbfood.foodname,tbfood.cost,
tbfood.cuisines,tbfood.paymentmode
from tbluser inner join tbfood on tbluser.flduser_id=tbfood.flduser_id;");
while($row=mysqli_fetch_array($query))