Jump to content

Can't connect to mysql server


Pr0t0n

Recommended Posts

Hey guys,

 

I am having problems when I started a class for mysql queries, and I am trying to connect in the __construct() but it doesnt matter how many diffrent servers I try it won't freaking connect PLEASE HELP lol.

 

Code is below:

function __construct() {
       
    $db 	= new mysqli($db_login_cred);
//    $db_conn	= mysqli_connect() or die(mysqli_error($db));
 
 if (mysqli_connect_error()) {
    die('Connect Error (' . mysqli_connect_errno() . ') '
            . mysqli_connect_error());
}

echo 'Success... ' . $db->host_info . "\n";
    
/*
    if(isset($db_conn)) {
	echo "Verbinding met de MySQL backend tot stand gebracht.";
    } else {
	echo "Kan de MySQL-backend niet bereiken.<br /><br />
	      Foutmelding:<br />"
	     .$error = $db_conn->mysqli_connect_error()
	     .$error;
    }
*/

There's some of my own code which is commented out in a try to use standard code from php.net to see if I made a typo or whatever.

 

 

I will keep this page open so if u need additional info I can supply it fast hopefully.

 

if u also want to see the output: http://odins.co.nf/

Link to comment
https://forums.phpfreaks.com/topic/285723-cant-connect-to-mysql-server/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.