![]() |
Query troubles \ question ..
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 |
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:
|
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] |
aight thanks
|
All times are GMT. The time now is 02:09 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:
|