belphegor Posted November 28, 2007 Share Posted November 28, 2007 hi, sorry abut my English. how can i make custom page to checked if Mysql is connect/work/online and if it is ok back "ON" if not back "OFF"? thanks for help. Quote Link to comment Share on other sites More sharing options...
belphegor Posted November 29, 2007 Author Share Posted November 29, 2007 Guys please this is very urgent me :'( Quote Link to comment Share on other sites More sharing options...
janim Posted November 29, 2007 Share Posted November 29, 2007 $connect=mysql_connect($database,$username,$password); if(!$connect){ echo "OFF"; }else{ echo "ON"; } is that what you searching for ? Quote Link to comment Share on other sites More sharing options...
belphegor Posted November 29, 2007 Author Share Posted November 29, 2007 i think.... so i need to do like this? <?php $connect=mysql_connect($database,$username,$password); if(!$connect){ echo "OFF"; }else{ echo "ON"; } ?> and change $database $username and $password..... ? the "$" need to be example for $username: $belphegor thanks for your help!! edit; or: <?php $dbms = 'mysql'; $dbhost = ''; $dbport = ''; $dbname = 'XXXX'; $dbuser = 'XXXX'; $dbpasswd = 'XXXX'; $connect=mysql_connect($database,$username,$password); if(!$connect){ echo "OFF"; }else{ echo "ON"; } ?> Quote Link to comment Share on other sites More sharing options...
belphegor Posted November 29, 2007 Author Share Posted November 29, 2007 ok, be arranged: <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?> thanks. 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.