winmastergames Posted December 29, 2007 Share Posted December 29, 2007 Hi well i made this script so you can add Servers to be checked and on another page you can view them but im having problems with viewing the Servers status it doesnt list them all it just lists the first one on the MYSQL database heres the script: <?php // connect to db // select db $db_host = "MYSQLHOST"; $db_username = "MYSQLUSER"; $db_password = "MYSQLPASS"; $db_name = "MYSQLDB"; $conn = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error()); mysql_select_db($db_name, $conn) or die(mysql_error()); $myquery = mysql_query("select * from MYSQLDB"); while($r=mysql_fetch_array($myquery)) { $rowname=$r["name"]; // put your field's name is where "their_website" is $rowurl=$r["url"]; // put your field's name is where "their_link" is $rowdescription=$r["description"]; // put your field's name is where "their_description" is } ?> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td width="77%"><font face="Arial, Helvetica, sans-serif" size="2"><?php echo "$rowname"; ?></font></td> <td width="23%"><img src="status.php?link=<?php echo "$rowurl"; ?>" width="37" height="20"></td> </tr> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td width="77%"><font face="Arial, Helvetica, sans-serif" size="2"><?php echo "$rowname"; ?></font></td> <td width="23%"><img src="status.php?link=<?php echo "$rowurl"; ?>" width="37" height="20"></td> </tr> Whats wrong and if you are trying to figure out what status.php is it just checks the server if its only and displays a image if its online or not Quote Link to comment https://forums.phpfreaks.com/topic/83563-solved-problem-with-my-script/ Share on other sites More sharing options...
sKunKbad Posted December 29, 2007 Share Posted December 29, 2007 Your output needs to be inside your loop, like this: $myquery = mysql_query("select * from MYSQLDB"); while($row = mysql_fetch_array($myquery)){ extract($row); echo"<table border='0' cellspacing='0' cellpadding='3'> <tr> <td width='77%'><font face='Arial, Helvetica, sans-serif' size='2'>$name</font></td> <td width='23%'><img src='status.php?link=$url' width='37' height='20'></td> </tr>"; } Quote Link to comment https://forums.phpfreaks.com/topic/83563-solved-problem-with-my-script/#findComment-425140 Share on other sites More sharing options...
winmastergames Posted December 29, 2007 Author Share Posted December 29, 2007 fff Quote Link to comment https://forums.phpfreaks.com/topic/83563-solved-problem-with-my-script/#findComment-425144 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.