redirect a page
| From: | Natividad Castro | Date: | Wed, 24 Apr 2002 16:01:21 +0000 |
| Subject: | redirect a page | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18771@lists.php.net to get a copy of this message | ||
Hi to all,
I have a search form where users can search for a specific record; up to now
is working fine, but what I would like to do is: if the record is not found,
redirect them to another page that says that record was not found. Can
anybody tell me how to do this? I already tried using this statement
if ( !mysql_fetch_array($result) ) {
include file // this the page that I want to redirect them, but it doen't
work
}
I would like to execute the first statement it's false:
e.g if name doesn't match with anything in the table, redirect to another
page
else execute the whole query.
$query = mysql_query("SELECT * from 150bk where trim(NAME) like '%" .
$legal_name . "%'");
while($query_data = mysql_fetch_array($query))
{
$id = trim($query_data[ID]);
$name = trim($query_data[NAME]);
$tracking_num = trim($query_data[TRACKING_NUMBER]);
$census = trim($query_data[CENSUS_NUM]);
$name_dba = trim($query_data[NAME_DBA]);
}
Any help, it's greatly appreciate
Thanks
Nato