Re: newbie

From: Date: Fri, 20 Oct 2000 00:02:53 +0000
Subject: Re: newbie
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21305@lists.php.net to get a copy of this message
At 02:03 PM 19/10/2000, John Black wrote:
Hello, As the subject states I am a PHP newbie. Our PHP guy left us and now I have to learn. Got some good books but I must be slow because I am still not getting it. Anyway, heres the deal. I have PHP3 and MySQL running on Red Hat. For the purpose of learning. I have created a db named ras_numbers. This db contains a table named ras_local. This table contains the fields ras_city, ras_areacode, ras_prefix, and ras_suffix. I have populated this db with our local access numbers. I have created a form that ask for the 3 digit prefix of a phone number and pass the variable prefix to a php file named do_prefix.php3. I can then run a Select statement --- $query = mysql_db_query($dbname, "SELECT ras_city, ras_areacode, ras_prefix, ras_suffix FROM ras_local Where ras_prefix = $prefix")or die(mysql_error()); If there is a match I can display the record. However, if there is not a match I would like it to preform another query that does a select *. I guess this would be accomplished using an IF then statement. But any I try cause the server to spike to 99% CPU utilization and stay that way until I kill the process. Any thoughts?
Hi John, What does the code look like? It sounds like it could have an infinate loop in the code making it do that (I doubt its your server because I take it, the current system you inherited still works fine.) Chris

« previous php.general (#21305) next »