Re: Check if Record was Entered Today.

From: Date: Fri, 25 May 2007 15:24:57 +0000
Subject: Re: Check if Record was Entered Today.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255646@lists.php.net to get a copy of this message
WORKS!! Thanks. On 5/24/07 5:34 PM, "Richard Lynch" <ceo@l-i-e.com> wrote: >> $db = dbase_open(try.dbf", 0); >> if ($db) { > > $exists = false; > $today = false; > >> $record_numbers = dbase_numrecords($db); >> for ($i = 1; $i <= $record_numbers; $i++) { >> $row = dbase_get_record_with_names($db, $i); >> >> $thedate = date(mdY); >> if(($row['ACC'] == $thekey) && ($row['DATE'] == >> $thedate)) >> { > //> echo "The Account Number has already been entered once > //> today"; > //> echo $row['DATE']." : ".$thedate; > //> exit; > $today = true; >> } >> else { > //> echo "The Account Number exists but not entered > //> today<br>"; > //> echo $row['DATE']." : ".$thedate; > //> exit; > > $exists = true; > >> } >> } >> } > > if ($today) echo "Yes, today."; > elseif ($exists) echo "Yes, but not today."; > else echo "No."; > > exit; completely halts a script and does NOTHING else. > > You maybe thought you wanted 'continue' or 'break' but those wouldn't > work for this either.

« previous php.general (#255646) next »