In message <[EMAIL PROTECTED]>, Mark Mckee
<[EMAIL PROTECTED]> writes
>I am using an sql statement to get the number of rows (users) in the DB, but
>how would I get it to distinguish between dates
>
> 
>
>$link = mysql_connect("localhost", "user", "pass");
>
>mysql_select_db("db", $link);
>
> 
>
>$result = mysql_query("SELECT * FROM table", $link);
>
>$num_rows = mysql_num_rows($result);

Not the most efficient... and you are using SELECT * again.  

You should only request the information that you need.  Here you are
saying, get me every field from every record in the table... and you
don't need any of the information.

You should have been using
"SELECT COUNT(*) AS total FROM table"

or in your specific "date" requirement, one INSERT statement, followed
by
"SELECT COUNT(*) AS total FROM table WHERE datefield < date_just_added"



And I don't approve of your domain name - Soddin' Gecko???  Around here,
Geckos are Good Guys, we allow them to run around the walls and ceilings
in the house, as they eat all the insects - so be NICE to them,
please... <G>
-- 
Pete Clark

Sunny Andalucia
http://www.hotcosta.com/comm_1.htm

Reply via email to