![]() |
help fix this error...
first im not know much about code so maybe the code have a little strange....
ok here we go... i want to show the top poster in last week in my main page so i use this code in index.php PHP Code:
in forumhome.....when i goto my main page i found the error message in my header... Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/squawell/public_html/XXX/forum/index.php on line 61 while ($xxx=mysql_fetch_array($post7day)){ want help....thankz...... |
$DB_site->query_first never returns a mysql result, it returns a normal php array.
remove the _first to get it working.. edit: just the query before the while loop is meant ;) |
Quote:
but it only show up usernamethe post number did not below is the template in top_thread PHP Code:
|
$post7dayuser=$DB_site->query_first("SELECT username FROM user WHERE userid=$xxx[userid]");}
you jhust read out username, not posts here ;) |
Quote:
|
PHP Code:
Code:
<a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$xxx[userid]>$post7day[username]</a><BR>$post7day[posts] |
Quote:
another question...if i want another code also use in same template should i put the code above this eval("\$topthread = \"".gettemplate("top_thread")."\";"); am i right? |
Xenon, how would you do this on a per forum type basis?
|
@squawell: yes right, every variabole appearing in the template has to be before that eval!
@boofo: it would slow down the query but i think this should do the trick: PHP Code:
|
Quote:
above ur code it will affect when u apply the code right?and the post number will recount after 7 days later is that right too?? :) |
All times are GMT. The time now is 01:38 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|