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.
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 }
Related Posts:
- Should I use mysqli_real_escape string() or mysql_real_escape_string() for form data?
- mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- Fatal error: Call to a member function bind_param() on boolean [duplicate]
- MySqli Commands out of sync; you can’t run this command now
- Commands out of sync; you can’t run this command now
- Call to undefined method mysqli_stmt::get_result
- Call to undefined method mysqli_stmt::get_result
- Fatal error: Cannot use object of type mysqli_result
- How to solve “Fatal error: Class ‘MySQLi’ not found”?
- mysql_field_name to the new mysqli
- mysqli_select_db() expects parameter 1 to be mysqli, string given
- mysqli::query(): Couldn’t fetch mysqli
- phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user ‘pma’@’localhost’ (using password: NO)
- Warning: mysqli_query() expects at least 2 parameters, 1 given. What? [duplicate]
- Deprecated: mysql_query() [duplicate]
- Object of class mysqli_result could not be converted to string
- Fatal error: Call to a member function fetch_assoc() on a non-object
- Having a problem getting mysqli_query to execute
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given… what I do wrong?
- Call to a member function fetch_assoc() on boolean in
[duplicate] - PHP variables don’t evaluate in the query [duplicate]
- What is a slug?
- PHP “or” Syntax
- What are namespaces?
- Get the full URL in PHP
- Invalid column count in CSV input on line 1 Error
- What is difference between PHP cli and PHP cgi?
- Why use $_SERVER[‘PHP_SELF’] instead of “”
- phpMyAdmin: secret passphrase?
- PHP how to make URL something like product.php?id=1
- Mixing a PHP variable with a string literal
- Forbidden :You don’t have permission to access /phpmyadmin on this server
- How to insert an item at the beginning of an array in PHP?
- PHP Deprecated: Methods with the same name
- How do I pass JavaScript variables to PHP?
- Call to undefined function curl_init().?
- How to verify password against database?
- what is a good method to sanitize the whole $_POST array in php?
- Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)
- Trying to get property of non-object in
- Difference between $_SERVER[‘DOCUMENT_ROOT’] and $_SERVER[‘HTTP_HOST’]
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- Fix Access denied for user ‘root’@’localhost’ for phpMyAdmin
- Getting connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
- “Cannot send session cache limiter – headers already sent”
- Refresh a page using PHP
- Unable to locate package libapache2-mod-php7
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- SSL error SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
- PDO closing connection
- “Valid CSRF Token Required” in Osticket After login?
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- Child theme css not overriding parent
- Convert timestamp to readable date/time PHP
- Creating a php search bar
- What does ‘
- Parsing domain from a URL
- PHP class not found but it’s included
- How to fix the session_register() deprecated issue?
- How to convert string to boolean php
- Are There Any Cron Jobs Alternative?
- How to Create Multiple Where Clause Query Using Laravel Eloquent?
- PHP: How to get referrer URL?
- php – How do I fix this illegal offset type error
- Warning: A non-numeric value encountered
- Proper Format of iframe in PHP?
- How to find the last day of the month from date?
- Getting ’ instead of an apostrophe(‘) in PHP
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- WooCommerce action hooks and overriding templates
- Updating php version on mac
- Composer: Command Not Found
- Undefined variable: $_SESSION
- Error:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
- The character encoding of the HTML document was not declared
- Notice: Undefined offset: 0 in
- How to Sort a Multi-dimensional Array by Value
- How to get time difference in minutes in PHP
- How to write a link like which link to the same page in PHP?
- Resetting MySQL Root Password with XAMPP on Localhost
- PHP – syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
- Insert string at specified position
- PHP + JQuery – How to use these two together? Please see my example
- Data extraction from /Filter /FlateDecode PDF stream in PHP
- How to use data-saferedirecturl in a tag in PHP?
- PHP date yesterday [duplicate]
- Clear cache in Symfony: `cache:clear` or `rm -rf`?
- create php live clock
- In where shall I use isset() and !empty()
- Converting a UNIX Timestamp to Formatted Date String
- PHP Call to undefined function
- Formatting a number with leading zeros in PHP
- POST an array from an HTML form without javascript