The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
variable with sql count results
i have the following line of code:
$user=$DB_site->query("SELECT COUNT(*) FROM post WHERE userid='$userid' AND review=1"); how do i get access to the count results? echo $user displays "resource id#12" |
#2
|
|||
|
|||
just to clarify, the goal of my code is to update the contents of a field with the number of rows that have the "review" flag set to 1.
|
#3
|
||||
|
||||
$user=$DB_site->query("SELECT COUNT(*) as posts FROM post WHERE userid='$userid' AND review=1");
echo number_format($user['posts']); |
#4
|
||||
|
||||
You also need to use $DB_site->query_first() instead of query().
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|