pentool Posted March 27, 2013 Share Posted March 27, 2013 Hello, I am opening a DB connection as such: $dbc = @mysqli_connect("localhost", M_USER, M_PASSWORD, M_DATABASE) OR die("Database connection failed"); It worked fine for months, and then today all of a sudden I didn't get any data from the DB any more. I had a brain fart and try to look everywhere. I knew it wasn't the code, since it worked so far. So to make the long story short, turned out that when I removed the ampersat (@) I saw the error "Fatal error: Call to undefined function mysqli_connect()". Something happened on the hosting account, and the mysqli extension just simply vanished or stopped working. This is new to me. So I'm just curious, is there a way to detect if an extension "disappears" for some reason and display some message as opposed to staring clueless at a blank screen? Thanks. PS: The hosting company responded that they recompiled mysql and now it's working again - but I have no clue why did it disappear on the first place. Link to comment https://forums.phpfreaks.com/topic/276214-fatal-error-call-to-undefined-function-mysqli_connect/ Share on other sites More sharing options...
trq Posted March 27, 2013 Share Posted March 27, 2013 So I'm just curious, is there a way to detect if an extension "disappears" for some reason and display some message as opposed to staring clueless at a blank screen?There are ways to check for the existence of a specific extension, yes, but everything in php is an extension so doing that everywhere would eb a nightmare.The hosting company responded that they recompiled mysql and now it's working again - but I have no clue why did it disappear on the first place.Because your hosting company are incompetent. Link to comment https://forums.phpfreaks.com/topic/276214-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1421376 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.