![]() |
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" |
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.
|
$user=$DB_site->query("SELECT COUNT(*) as posts FROM post WHERE userid='$userid' AND review=1");
echo number_format($user['posts']); |
You also need to use $DB_site->query_first() instead of query().
|
All times are GMT. The time now is 02:42 PM. |
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:
|