I think, there is something wrong with PHP configration.
First, debug your database connection using this script at the end of ./config/database.php :
... ... ... echo '<pre>'; print_r($db['default']); echo '</pre>'; echo 'Connecting to database: ' .$db['default']['database']; $dbh=mysql_connect ( $db['default']['hostname'], $db['default']['username'], $db['default']['password']) or die('Cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db['default']['database']); echo '<br /> Connected OK:' ; die( 'file: ' .__FILE__ . ' Line: ' .__LINE__);
Then see what the problem is.
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
- 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
- mysqli::query(): Couldn’t fetch mysqli
- Deprecated: mysql_query() [duplicate]
- Having a problem getting mysqli_query to execute
- How to prevent the “Confirm Form Resubmission” dialog?
- How to use mysqli_query() in PHP?
- What is a slug?
- How to log in to phpMyAdmin with WAMP, what is the username and password?
- Fatal error: Call to undefined function mysql_connect()
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- Mysql query- How to use contains?
- Invalid column count in CSV input on line 1 Error
- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in
- Invalid column count in CSV input on line 1 Error
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
- $wpdb->update or $wpdb->insert results in slashes being added in front of quotes
- PDO with INSERT INTO through prepared statements
- phpMyAdmin: secret passphrase?
- PDO bindParam() with prepared statement isn’t working
- Forbidden :You don’t have permission to access /phpmyadmin on this server
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- What does __FILE__ mean?
- Creating a search form in PHP to search a database?
- How can I do ‘insert if not exists’ in MySQL?
- Trying to get property of non-object in
- Fix Access denied for user ‘root’@’localhost’ for phpMyAdmin
- Getting connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
- Call to undefined method mysqli_stmt::get_result
- Call to undefined method mysqli_stmt::get_result
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- How can I do ‘insert if not exists’ in MySQL?
- 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
- Object of class DateTime could not be converted to string
- What does it mean to escape a string?
- Convert from MySQL datetime to another format with PHP
- MAMP “Apache couldn’t be started because port is in use.” AND “Can’t connect to local MySQL server through /tmp/mysql.sock
- mysqli_select_db() expects parameter 1 to be mysqli, string given
- Unexpected Exception: SQLSTATE[HY000] [1045] Access denied for user ****@’localhost’ (using password: YES)
- Uncaught Error: Call to undefined function mysql_escape_string()
- phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user ‘pma’@’localhost’ (using password: NO)
- Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
- Call to a member function on null?
- Warning: mysqli_query() expects at least 2 parameters, 1 given. What? [duplicate]
- SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
- Only variable references should be returned by reference – Codeigniter
- Warning: mysqli_query() expects parameter 1 to be mysqli, resource given
- MySQL query to get column names?
- What does MYSQLI_NUM mean and do?
- Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)
- Mysql where id is in array
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- What is the advantage of using try {} catch {} versus if {} else {}
- select * from table where column = value ^ column2= value
- Object of class mysqli_result could not be converted to string
- No query results for model [App\Products] Laravel
- Fatal error: Call to a member function fetch_assoc() on a non-object
- Fatal error: Call to a member function query() on null
- mysqlworkbench giving version error on exporting database
- How to make DROP INDEX IF EXISTS for mysql?
- What is the meaning of sprintf(): Too few arguments
- Can I store images in MySQL
- MySQL Daemon Failed to Start – centos 6
- Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given… what I do wrong?
- How to insert TIMESTAMP into my MySQL table?
- How to remove index.php from WordPress site URL
- PHP Like thing similar to MySQL Like, for if statement?
- How get value from URL
- Object of class stdClass could not be converted to string
- Call to a member function fetch_assoc() on boolean in
[duplicate] - How to use Memcached with PHP7?
- select count(*) from table of mysql in php
- PHP variables don’t evaluate in the query [duplicate]
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ””)’ at line 2
- Get user role by ID WordPress
- How to fix syntax error, unexpected T_IF error in php?
- Unzip a file with php
- Difference between require, include, require_once and include_once?
- Php – Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- cannot change admin password, wordpress on godaddy
- How can I call a row of user specific data from a custom table added to the WP Database
- Create a quick start wordpress installation [closed]
- Ordering users by custom user meta
- Multiple meta_key in one global $wpdb;
- Most commented posts by time period (last 12h, last 24h and etc)
- Modify WooCommerce used to get all orders in dashboard
- cant insert data in a custom table in phpmyadmin
- How to pass username into form that sends data to database