MySQL Forums
Forum List  »  PHP

cannot connect to sql server
Posted by: jj krause
Date: January 15, 2015 10:58AM

i get this error code when trying to connect to the sql server threw my php website.


( ! ) Warning: mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it. in C:\wamp\www\Cemetery Databases\search.php on line 27
Call Stack
# Time Memory Function Location
1 0.0010 190608 {main}( ) ..\search.php:0
2 0.0011 191240 mysqli_connect ( ) ..\search.php:27

( ! ) Notice: Use of undefined constant mysqli_error - assumed 'mysqli_error' in C:\wamp\www\Cemetery Databases\search.php on line 27
Call Stack
# Time Memory Function Location
1 0.0010 190608 {main}( ) ..\search.php:0
mysqli_error


connection string

$conn = mysqli_connect("$host","$user","$pass") or die(mysqli_error);
mysqli_select_db("$db_name") or die(mysqli_error());

Options: ReplyQuote


Subject
Written By
Posted
cannot connect to sql server
January 15, 2015 10:58AM
January 15, 2015 02:53PM
January 15, 2015 06:06PM
January 16, 2015 07:22AM
January 15, 2015 02:38PM
January 15, 2015 02:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.