The Arcive of vBulletin Modifications Site. |
|
help fix this error... Details »»
|
|||||||||||||||||||||||||
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...... Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
$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
|
|
#3
|
||||
|
||||
|
Quote:
![]() ![]() ![]() but it only show up usernamethe post number did not below is the template in top_thread PHP Code:
|
|
#4
|
||||
|
||||
|
$post7dayuser=$DB_site->query_first("SELECT username FROM user WHERE userid=$xxx[userid]");}
you jhust read out username, not posts here
|
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
||||
|
||||
|
PHP Code:
Code:
<a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$xxx[userid]>$post7day[username]</a><BR>$post7day[posts] |
|
#7
|
||||
|
||||
|
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? |
|
#8
|
||||
|
||||
|
Xenon, how would you do this on a per forum type basis?
|
|
#9
|
||||
|
||||
|
@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:
|
|
#10
|
||||
|
||||
|
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??
|
![]() |
|
|