What is wrong with this code? - Joomla! Forum - community, help and support


the following code indeed display users within flashchat once no 1 within chatroom, blank instead of saying " chatroom empty"

code: select all

$database->setquery("select #__users.username #__users,"
. "\n #__fc_connections #__fc_connections.userid = #__users.id"
. "\n order updated desc");
$userlist = $database->loadobjectlist();
$content = "";

if (count($userlist > 0)) {
$content .= "<table cellpadding=0 cellspacing=0 border=0>\n";
foreach ($userlist $chatter){
$content .= "<b>$chatter->username</b>\n";
}
$content .= "</table>\n";
} else {
$content .= "chatroom empty\n";
}
?>


thanks help.

-efrain

are sure query correct?

could change upper part see if there errors in query:

code: select all

<?php
$database->setquery("select #__users.username #__users,"
. "\n #__fc_connections #__fc_connections.userid = #__users.id"
. "\n order updated desc");
$userlist = $database->loadobjectlist();
echo $database->geterrormsg();
$content = "";
?>


edit:

ah, there's error here:

code: select all

<?php
if (count($userlist > 0)) {
?>


should this:

code: select all

<?php
if (count($userlist) > 0) {
?>





Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums