PDA

View Full Version : need user details from thread table


khaleejy
01-11-2003, 06:34 AM
hi


$topts=$DB_site->query("SELECT COUNT(threadid) AS threads, username, postuserid FROM thread LEFT JOIN user ON(user.userid=thread.postuserid) GROUP BY thread.postuserid ORDER BY threads DESC LIMIT 10");
$toptsbits = "";
$level=0;
while($topt=$DB_site->fetch_array($topts)) {
$level++;
$threadcount=$topt['threads'];
$topusername=$topt['username'];
$userid=$topt['postuserid'];
eval("\$toptsbits .= \"".gettemplate('forumhome_topts')."\";");
}
$DB_site->free_result($topts);


eval("dooutput(\"".gettemplate("top_threadstarter")."\");");


could any one moditfy my script so that i can get the user register date, user email , user last seen date??

curley
01-11-2003, 01:05 PM
$threadcount=$topt['threads'];
$topusername=$topt['username'];
$userid=$topt['postuserid'];


i couldnt swear to it but i would say do this instead

$threadcount=$topt[threads];
$topusername=$topt[username];
$userid=$topt[postuserid];

khaleejy
01-11-2003, 02:52 PM
theres nothing wronge with it.. its working fine

Xenon
01-12-2003, 12:29 PM
change this:$topts=$DB_site->query("SELECT COUNT(threadid) AS threads, username, postuserid FROM thread LEFT JOIN user ON(user.userid=thread.postuserid) GROUP BY thread.postuserid ORDER BY threads DESC LIMIT 10");
into
$topts=$DB_site->query("SELECT COUNT(threadid) AS threads, user.username, user.lastvistit, user.lastactivity, user.joindate, postuserid FROM thread LEFT JOIN user ON(user.userid=thread.postuserid) GROUP BY thread.postuserid ORDER BY threads DESC LIMIT 10");

then you can use $topt[joindate] and so on

khaleejy
01-12-2003, 01:48 PM
thanks alot :)