问题
I'm got a little bit problem when I try to run this code.
My problem is on line 32:
回答1:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in
mysqli_fetch_array's 1st parameter must be a result of a query. what you are doing is you are you are passing the connection(which doesnt makes sense) and the query command itself.
read the doc here: http://php.net/manual/en/mysqli-result.fetch-array.php
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
}
回答2:
You write sql query but didn't execute.
$sql = "select * from privinsi";
$results = myqli_query($connection,$sql);
while($r = mysqli_fetch_array($results){
//enter your code here
}
来源:https://stackoverflow.com/questions/40304560/warning-mysqli-fetch-array-expects-parameter-1-to-be-mysqli-result-object-gi