avianrand Posted February 17, 2011 Share Posted February 17, 2011 I don't know if this is a hosting issue (with bluehost) or not. I checked the phpinfo and they're running php 5.2.16 on the server I'm on. And as far as I can tell, mysqli should be running fine. I have a few pages I'm running locally on my development machine and all runs well. But on the host's server I'm getting a connection failure error. I know my connect function is being run because when echo the $dbname and the other 3 parameters they show up on the page. Here's my connect function: function getDBLink() { include('/home1/mysite/private/config.php'); $link = mysqli_connect($dblocation, $dbuser, $dbpass, $dbname); /* check connection */ if (mysqli_connect_errno()) { printf("Connection failed: %s\n", mysqli_connect_error()); exit(); } return $link; } I've spent hours rechecking the spelling on all the params to be sure of no typos. If I change mysqli_connect to mysql_connect, it does connect (but all the subsequent code using mysqli to query the tables fails). So it's a mysqli issue I'm thinking. I don't really want to change everything to mysql from mysqli if I don't have to. This should work. Any ideas why I'd be having this problem? I'm not an expert at any of this. Hoping someone out there that is might see something I'm not seeing. Quote Link to comment https://forums.phpfreaks.com/topic/227945-mysqli-and-bluehost-problem-maybe/ Share on other sites More sharing options...
avianrand Posted February 17, 2011 Author Share Posted February 17, 2011 Okay. Never mind. This is embarrassing. I must have been really blurry eyed earlier after working on this for so long. I found a typo in one of the connection parameters. It's working fine now. Should have waited 10 minutes longer before posting my question! LOL. Quote Link to comment https://forums.phpfreaks.com/topic/227945-mysqli-and-bluehost-problem-maybe/#findComment-1175426 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.