All good information, thank you very much

 

Btw, its soddengecko not soddin. There is no cruelty around here

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Pete
Sent: 14 May 2007 23:19
To: [email protected]
Subject: Re: [php-list] after certain date do this....

 

In message <[EMAIL PROTECTED]>, Mark Mckee
<[EMAIL PROTECTED] <mailto:lists%40soddengecko.com> > 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

 



[Non-text portions of this message have been removed]

Reply via email to