Hello
I’m having this problem were as I want to visit my php pages this error shows up:
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [1130] Host ‘srv37.000webhost.com’ is not allowed to connect to this MySQL server’ in /home/a92XXXX73/public_html/includes/db.php:7 Stack trace: #0 /home/a92XXXX73/public_html/includes/db.php(7): PDO->__construct(‘mysql:host=DB_H…’, ‘DB_USERNAME’, ‘DB_PASSWORD’) #1 /home/a92XXXX73/public_html/Zaken.php(2): require_once(’/home/a92XXXX73/…’) #2 {main} thrown in /home/a92XXXX73/public_html/includes/db.php on line 7
You are defining db login details with mysql syntax, and then your actual connection uses PDO… the PDO definitions (“DB_HOST” etc) dont match the mysql definitions (“mysql_host”). Two different definitions using two different PHP functions.
Suggest using mysql connection instead of PDO, considering your mysql login details above are already correct…
Doug u are very correct!!
This solution is perfect… All the php people use this only…
$connect = @mysql_connect($mysql_host, $mysql_user, $mysql_password)or die(mysql_error());
$db = @mysql_select_db($mysql_database,$connect)or die(mysql_error());
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
This forum is intended for users to post useful snippets or applications for other users to utilize.
It is not intended to be a place where you post snippets of your malfunctioning code and ask for help.
You have to create the database using MySQL icon before you can use it
It might take a few hours from the time you create or make any changes until it is available, please make sure you check using PHPMyAdmin first before you try to configure it with your application.
If you have a problem with your database, change your password or delete and create it and try again.
Remote Mysql is not allowed on free hosting, upgrade to paid hosting then you can do remote Mysql