how i add userid to show profile in this condition.. i am getting multiple results thats why not able to get uid from user table..
PHP Code:
$shoutlist=$db->select("SELECT message, username, groupid, mstime FROM shout ORDER BY mstime DESC LIMIT 0,15");
if($shoutlist)
{
print "<br/>";
$allshouts="";
foreach($shoutlist as $shout)
{
if(strlen($shout->message) > 160){ $shout->message = substr($shout->message,0,160)."~"; } $shout->message=bbcode(htmlentities($shout->message));
$shout->message=smiley($shout->message);
$TimeZone="+5.30";
$mstime=$shout->mstime + ($TimeZone * 60 * 60);
$mstime=date("g:ia",$mstime);
$uid=mysql_fetch_array(mysql_query("SELECT userid FROM users WHERE username='".$shout->username."'")); // getting multiple usernames as limit defined to 15 .. how i do it?
$allshouts .= "<span style=\"font:normal 8pt verdana;\"><a href=\"".$config->url."profile.php?uid=".$uid[0]."\"><font color=\"".$group[$shout->groupid]['color']."\"><b>".$shout->username."</b></font></a>($mstime)-->".$shout->message."</span><br/>";
}
print $allshouts;
print "<br/>";
unset($shoutlist);unset($allshouts);
}
Comment