Quote:
Originally Posted by x3n0
<?php
## """"" INCLUDE """"""""""""""""""""""""""""""""""""""""""""
include('./config/database.php'); # Read Database-Variables
## """"" INCLUDE """"""""""""""""""""""""""""""""""""""""""""
switch(false){
case($db = @mysql_connect($cfg['server'],$cfg['user'],$cfg['password'])):
$mysqlERROR = mysql_error();
break;
case($dat = @mysql_select_db($cfg['database'],$db)):
$mysqlERROR = mysql_error();
break;
}
if(!$mysqlERROR) {
## """"" INCLUDE """"""""""""""""""""""""""""""""""""""""""""
include('./inc/func.get_config.php'); # Read Configuration-Data
## """"" INCLUDE """"""""""""""""""""""""""""""""""""""""""""
}
# $sql = 'SELECT * FROM zz_user WHERE user!=\'admin\' and status=\'0\''; # -- get user currently online
$sql = 'SELECT * FROM '.$cfg['userdat'].' WHERE status=0';
$result = mysql_query($sql, $db);
$number = mysql_num_rows($result);
//No Users Online
if ($number==0)
{
$number= "No users in chat";
echo $number;
}
//Users Online
else
{
$message = "$number users in chat:";
echo $message;
echo "<p>";
for ($i=0; $i<"$number"; $i++)
{
$row=mysql_fetch_array($result);
$id=$row[2];
echo "$id<br>";
}
echo "<p>";
}
mysql_free_result($result);
?>
|
so this whole thing is a query you need to do in sql? (I am still learning lol)