HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean given - warning



I have this error mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean given - how to solve it?

Example 1: IN operator Syntax
<?php
$sql="SELECT * FROM customers WHERE id=".$id."";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {

$first_name = $row["first_name"];
$last_name = $row["last_name"];
$email = $row["email"];
$password = $row["password"];

echo "id: " . $row["id"]. " - Name: " . $row["first_name"]. " " . $row["last_name"]. "<br>";
}
?>
I've read it has something to do with my query being wrong, but it has worked on my hosting provider so that can't be it!


mysqli_fetch_array Mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean given - php mysqli

3284. PHP mysqli_query() Function - mysqli query, sql tutorial
PHP mysqli_query() Function - mysqli query sql tutorial
https://www.agernic.com/sql-tutorial/php-mysqli_query-function-database-mysqli.html

3273. Uncaught Error: Call to undefined function MYSQL_NUM_ROWS() in, php mysqli
Uncaught Error: Call to undefined function MYSQL_NUM_ROWS() in php mysqli
https://www.agernic.com/php-mysqli/uncaught-error-call-to-undefined-function-mysql_num_rows().html

3272. Mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean given, php mysqli
Mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean given php mysqli
https://www.agernic.com/php-mysqli/mysqli_fetch_array()-expects-parameter-1-to-be-mysqli_result-boolean-given.html

3285. PHP mysqli_connect () Function, sql tutorial
PHP mysqli_connect () Function sql tutorial
https://www.agernic.com/sql-tutorial/php-mysqli-connect-function.html

1270. mysqli_num_rows to get number of rows or records in a result set returned from database
mysqli_num_rows to get number of rows of data from resultset in PHP MYSQLI
https://www.plus2net.com/php_tutorial/mysqli_num_rows.php

1269. mysqli_num_fields to get number of fields or columns in a result set returned from database
mysqli_num_fields to get number of column from resultset in PHP MYSQLI
https://www.plus2net.com/php_tutorial/mysqli_num_fields.php

Your add here
PHP count() Function

PHP html_entity_decode() function

PHP print() function

PHP empty() Function

PHP similar_text() function

PHP strcmp() function

PHP strtolower() function

PHP str_split() function

PHP strlen() function

PHP htmlspecialchars() function

PHP isset() Function

PHP explode() function

PHP printf() function

PHP ucfirst() function

PHP strip_tags() function

PHP strtoupper() function

PHP Data Types
CSS Border Style Width and Color
HTML div border color
CSS font color
SQL COUNT(), AVG() and SUM() Functions
HTML Image Border