|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
help with count(*)
Hey there,
I've got a tagboard where I want to only show the last 10 entries. to get all of the tagboard items I do: so next I try to get the count of items with: the problem with this is that I don't seem to be getting the actual number back to $count. When I try to print it I get 'Resource id #2'. I was thinking of doing something like: then: thanks for any help! |
|
#2
|
|||
|
|||
|
RE: help with count(*)
change:
$count = mysql_query ($query2,$dbh); to: $result = mysql_query($query2,$dbh); $row = mysql_fetch_row($result); $count = $row[0]; But, a better way would be to use a query such as: SELECT * FROM tagboard ORDER BY id DESC LIMIT 10 that will get you the 10 items from the tagboard table with the largest id's. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > help with count(*) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|