Hello guys,
I wanted a script that shows how many are online(Not who is online) Just the count. And a server time script. Thanks in advance
Hello guys,
I wanted a script that shows how many are online(Not who is online) Just the count. And a server time script. Thanks in advance
Code:mysql_select_db('pw'); $countonline = mysql_query("SELECT COUNT(*) AS nb_player FROM point WHERE uid NOT IN (SELECT userid FROM pw.auth) and zoneid IS NOT NULL"); $onlinecount = mysql_fetch_array($countonline); <?php echo $onlinecount; ?>
Any guide on installing it? I installed it on port 80 and here is what it shows: Blank page saying
- - - Updated - - -mysql_select_db('pw'); $countonline = mysql_query("SELECT COUNT(*) AS nb_player FROM point WHERE uid NOT IN (SELECT userid FROM pw.auth) and zoneid IS NOT NULL"); $onlinecount = mysql_fetch_array($countonline);
I also wanted to know why is this script not working, Shows blank page only
<?php
$host="localhost";
$username="root";
$password="done";
$database="pw";
$table="online";
mysql_connect("$host", "$username", "$password") or die (mysql_error());
mysql_select_db("$database") or die (mysql_error());
session_start();
$session = session_id();
$time = time();
mysql = ''SELECT * FROM $table WHERE session='$session'";
$result = mysql_query($mysql);
$count = mysql_num_rows($result);
if($count == NULL)
mysql_query("INSERT INTO $table (session, time) VALUES ('$session','$time')");
else
mysql_query(UPDATE $table SET time='$time' WHERE session = 'session'");
$count_user = mysql_query("SELECT * FROM $table");
$count_user = mysql_num_rows($count_user);
echo"$count_user";
mysql_query("DELETE FROM #table WHERE time < $time-10");
mysql_close();
Code:<?php #Author: Ben Noitov (Romulan) $DB_Host = "DBSERVER:3306"; // localhost or your IP $DB_User = "DBUSER"; // Database user $DB_Password = "DBPASSWORD"; // Database password $DB_Name = "DBNAME"; // Database name $ServerIP = "SVRIP"; // IP your PW Server or 127.0.0.1 $ServerPort = "PWPORT"; // Port your PW Server $db_link = mysql_connect($DB_Host, $DB_User, $DB_Password); $db = mysql_select_db("$DB_Name", $db_link); $online = mysql_query("SELECT zoneid FROM point WHERE zoneid IS NOT NULL"); $countonline = @Mysql_num_rows($online); $sockres = @fsockopen($ServerIP, $ServerPort, $errno, $errstr, 1); if (!$sockres) { mysql_query("DELETE FROM online"); $online = 0; $ServerStatus = "<font color=red><b>Under Maintance</b></font>"; $ServerPlayer = "<font color=red><b>0</b></font>"; } else { @FClose($sockres); $ServerStatus = "<font color=green><b>Online</b></font>"; $ServerPlayer = "<font color=green><b>$countonline</b></font>"; } ?> <table width="300" border="0" cellspacing="2" cellpadding="2"> <tr> <th scope="col"><strong>Server</strong></th> <th scope="col"><strong>:</strong></th> <th scope="col"><strong><?php print $ServerStatus; ?></strong></th> </tr> <tr> <th scope="col"><strong>Player Online</strong></th> <th scope="col"><strong>:</strong></th> <th scope="col"><strong><?php print $ServerPlayer; ?></strong></th> </tr> </table>
Working:33, Thank you alot
- - - Updated - - -
Working:33, Thank you alot
- - - Updated - - -
@hrace009 , Do you mind giving me a hand installingI did put everything in the right place and added the table to phpmyadmin and it actully works when I manually edit it from phpmyadmin.http://forum.ragezone.com/f751/release-universal-mysql-top-100-a-877885/
What I need help with is how to let phpmyadmin conifgure it automatically.