dinozz
07-18-2002, 07:12 PM
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
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