newbie
| From: | John Black | Date: | Thu, 19 Oct 2000 19:03:06 +0000 |
| Subject: | newbie | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-21231@lists.php.net to get a copy of this message | ||
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?
Thanks,
John Black