ttocskcaj Posted January 31, 2011 Share Posted January 31, 2011 How do you check if a MySQL or MySQLi server is available through php. I'm trying to make a short script that makes sure the users server can run the application. Like all the popular ones do Quote Link to comment Share on other sites More sharing options...
requinix Posted January 31, 2011 Share Posted January 31, 2011 Easiest thing is to just try to connect. Like, normally. With the username and password and all that. If it bombs (eg, times out) then either there's no server there or the connection info is wrong. Quote Link to comment Share on other sites More sharing options...
ttocskcaj Posted January 31, 2011 Author Share Posted January 31, 2011 That's what I'm doing at the moment. I would like to check before they enter any configurations though. Ie the MySQL server doesn't have a server to connect to yet. Is there a way to check if the MySQL extension is enabled? Quote Link to comment Share on other sites More sharing options...
requinix Posted February 1, 2011 Share Posted February 1, 2011 How will you know where to look for a server if they haven't told you yet? You can check for the extensions with extension_loaded. Quote Link to comment 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.