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"
thanks help.
-efrain
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:
edit:
ah, there's error here:
should this:
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
Post a Comment