error for mysql
| From: | Kurth Bemis | Date: | Wed, 11 Oct 2000 02:08:11 +0000 |
| Subject: | error for mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19463@lists.php.net to get a copy of this message | ||
hey all
have a feature that i'd like to add into scripts that querry a mysql table.
i want to have it display a message like - cannot access database at this time. please retry later. or something like that...
i have a snippet...and am wondering how to integrate it with my existing code.....
function error ($err) {
echo "<h1>$err</h1><hr>";} script in here..
$fp = @fopen($file,"r");
if(!$fp) {
print_error("Cannot open file: $file");
break;
}
How would i integrate that with this -
$titleresult= mysql_query("SELECT * from validtables WHERE dbtables = '$data'",$db); // sql query to get title and message info from db
while ($myrow = @mysql_fetch_array($titleresult)) { // get the data from the query and put it into vars
$title = $myrow["title"];
$message1 = $myrow["message1"];
$message2 = $myrow["message2"];
$message3 = $myrow["message3"];
}
any ideas?
~kurth
Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
kurth@usaexpress.net
http://www.usaexpress.net/kurth
ICQ - 6624050
Call Sign - N1TYW
PGP key available - http://www.usaexpress.net/kurth/pgp
Fight Weak Encryption! Donate your wasted CPU cycles to Distributed.net (http://www.distributed.net)