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. Link to comment https://forums.phpfreaks.com/topic/79304-solved-checked-mysql-work-back-ok-or/ 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 :'( Link to comment https://forums.phpfreaks.com/topic/79304-solved-checked-mysql-work-back-ok-or/#findComment-402001 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 ? Link to comment https://forums.phpfreaks.com/topic/79304-solved-checked-mysql-work-back-ok-or/#findComment-402023 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"; } ?> Link to comment https://forums.phpfreaks.com/topic/79304-solved-checked-mysql-work-back-ok-or/#findComment-402137 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. Link to comment https://forums.phpfreaks.com/topic/79304-solved-checked-mysql-work-back-ok-or/#findComment-402166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.