mysql - mysql_connect() error in php connection class -
am getting following error when trying access log in page:
warning: mysql_connect() [function.mysql-connect]: mysql server has gone away in c:\wamp\www\members\connection.php on line 7 warning: mysql_connect() [function.mysql-connect]: error while reading greeting packet. pid=3688 in c:\wamp\www\members\connection.php on line 7 warning: mysql_connect() [function.mysql-connect]: mysql server has gone away in c:\wamp\www\members\connection.php on line 7 fatal error: maximum execution time of 60 seconds exceeded in c:\wamp\www\members\connection.php on line 7
the code connection class looks this:
<?php $mysql_hostname = "localhost:8081"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "hospital"; $prefix = ""; $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("could not connect database"); mysql_select_db($mysql_database, $bd) or die("could not select database"); ?>
can 1 please?
the url using access page is: localhost:8081/members
mind you: other web folders accessible root folder using prefixed localhost , port number, folder 'members' has error.
change $mysql_hostname = "localhost:8081";
to $mysql_hostname = "localhost";
mysql use 3306
default port.
or $mysql_hostname = "localhost:3306";
or other port mysql listning
Comments
Post a Comment