List Info

Thread: How to get the number of a certain record only?(using MySQL)




How to get the number of a certain record only?(using MySQL)
user name
2006-07-29 15:29:06
Hi all,

How to get the number of a certain kind of records only, not
the other
fields i dont want?
I know I can get the number records using "select *
from table ..." and
then use mysql_num_rows() to know how many records was
selected, but is
there a quicker way that i can get the numbers without
having to
"select" all of the records first?

Thanks for suggestions!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

How to get the number of a certain record only?(using MySQL)
user name
2006-07-29 16:07:50
Just replace SELECT * FROM with SELECT COUNT(*) FROM this
will return the
number of rows

Simon 

-----Original Message-----
From: phpmysqlgooglegroups.com [mailto:phpmysqlgooglegroups.com] On Behalf
Of Ankh
Sent: 29 July 2006 17:29
To: PHP & MySQL
Subject: How to get the number of a certain record
only?(using MySQL)


Hi all,

How to get the number of a certain kind of records only, not
the other
fields i dont want?
I know I can get the number records using "select *
from table ..." and
then use mysql_num_rows() to know how many records was
selected, but is
there a quicker way that i can get the numbers without
having to
"select" all of the records first?

Thanks for suggestions!





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )