The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
i wanna count how many X items a user have.
so i set up this query: PHP Code:
now i want to count it... so how do i add to the query or count the number of item'sID with in the array which is formed? i want it to have lika a varable, $total = (number of items found according to item's id). hope i got it clear enough... :P |
#2
|
|||
|
|||
![]()
ok will this work?
mysql_num_rows( $result ); ok it will probably work... but, how can i create a multi-dimensional array from the result? say it will return 3 rows, each row and its id number, so it will be like that: PHP Code:
|
#3
|
||||
|
||||
![]()
You can't turn a multidimensional array via MySQL. To answer your original question you'll need to use MySQL's COUNT() function like so:
[sql] SELECT COUNT(*) as total FROM user WHERE userid = 1 [/sql] |
#4
|
|||
|
|||
![]()
aight thanks
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|