![]() |
thread and reply count
Hello, i tried to make an hack to count the number of threads and replies of every member of my forum.
I tried to do that with the following query : $usertherd = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] "); $usertherdcoun = $usertherd[total]; $userpostdcoun = $post[posts] - $usertherdcoun ; $userscann = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] AND forumid=37"); $userscann1 = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] AND forumid=20"); $userscann2 = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] AND forumid=12"); $userscanncoun = $userscann[total]+$userscann1[total]+$userscann2[total] ; i put this in function.php below this lines: $post[homepage]=""; $post[findposts]=""; $post[signature]=""; $onlinestatus=""; } Now, the problem is that, when i delete a member without deleting his posts i have the following error message : Database error in vBulletin 2.2.6: Invalid SQL: SELECT COUNT(threadid) AS total FROM thread WHERE postuserid= mysql error: You have an error in your SQL syntax near '' at line 1 mysql error number: 1064 help me please thanks |
yea I got that as well when it was an "unregistered" person posting.... Please help
|
put an if clause around the query that makes sure userid is set.
Amy |
use this code:
PHP Code:
|
All times are GMT. The time now is 12:37 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:
|