if ($username&&$password) { //connect to database $connect = mysql_connect("dbhost", "mysql_user", "mysql_password" or die("Couldn't connect to database" ));
mysql_select_db("dbname" ) or die("Couldnt find database " );
....
Localhost/mysql password in cmd works (for root) /phpmyadmin (logs in and lets me create tables etc) are all working . But the problem is that when i try connecting i seem to get only this error.
) Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\test\Task 2 Coursework\Login.php on line 22 Call Stack # Time Memory Function Location 1 0.0008 684792 {main}( ) ..\Login.php:0 2 0.0012 686800 mysql_connect ( ) ..\Login.php:22
If u think it might be a port problem, its not as the apache is set to .80 and sql normal on 3306 (edited)
How can i arrange this?
Edited 2 time(s). Last edit at 11/29/2012 08:22PM by Luca.
Could not connect to MySQL: php_network_getaddresses: getaddrinfo failed: No such host is known.
Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\test\testmysql.php on line 8
$dbhost ="127.0.0.1"; $dbuser="root";
Edited 1 time(s). Last edit at 11/29/2012 08:46PM by Luca.
Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'mysql_user'@'localhost' (using password: YES) in C:\wamp\www\test\Task 2 Coursework\Login.php on line 22
But im sure i changed the pass from the user>privilages in phpmyadmin