Re: if(), else() problem!

From: Date: Fri, 06 Oct 2006 17:59:14 +0000
Subject: Re: if(), else() problem!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-242769@lists.php.net to get a copy of this message
Works like a charm!! I was trying something out with having a variable go completely out of the functions & loops and print the "not found" message, but I wasn't hitting it. You did! // ^^^--- now tested ;) On 10/6/06 1:52 PM, "Jochem Maas" <jochem@iamjochem.com> wrote: > $msg = 'cannot open database!'; > if ($db = dbase_open("osm.dbf", 0)) { > $msg = 'database contains no records!'; > if ($record_numbers = dbase_numrecords($db)) { > $msg = 'number not found'; > for ($i = 1; $i <= $record_numbers; $row = > dbase_get_record_with_names($db, $i),$i++) > if ($row['PHONE'] == $thekey) { $msg = 'number found'; break; } > } > } > echo $msg; > // ^^^--- untested > Rahul S. Johari Supervisor, Internet & Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: rahul@informed-sources.com http://www.informed-sources.com

« previous php.general (#242769) next »