I really like the re-coding it's great.  I'm still new and below code is 
definitely more efficient.

FYI: I do have date field sorry I wasn't so clear.  I just didn't post all 
code.

""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Doing a select to get every record, and then looping through them all,
> concatenating a bunch of stuff together, and then using PHP to test ==
> is not very efficient...
>
> Why not just:
>
> $sql = array_map('mysql_real_insert_string', $POST);
> $query = " select count(*) from central ";
> $query .= " where conName = $sql[conName] ";
> $query .= "   and conAddress = $sql[conAddress] ";
> .
> .
> .
> $query .= "   and SOME_DATETIME_FIELD_WHEN_THEY_REGISTERED >=
> date_sub(now(), interval 1 day) ";
>
> Also note that your are currently comparing the $_POST['timeStamp']
> which is *probably* generated at the time the HTML form was sent with
> time(); which is when the script is processing, which will be MUCH
> less than one day, unless a user opens up the form, walks away for 24
> hours, and then comes back to complete registration...
>
> You need a field in the database from previous registration to compare
> to time().

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to