I need to be able to determine if a value is not found within a database and if so, 
report that the data and or row is not available back to the browser.

Here is my script that I am using to retrieve the data:

>>>>>> SNIP >>>>>>>>>

$dbh = DBI->connect("DBI:Informix:domain",
                    {
                      RaiseError => 1,
                      AutoCommit => 0
                    }
                    );

$sth = $dbh->prepare("update reg_info set active = ? where domain_name = ?");
$sth->bind_param( 1, $postInputs{'active'} );
$sth->bind_param( 2, $postInputs{'domain_name'} );
$sth->execute();

$sth = $dbh->prepare("select * from reg_info where domain_name = ? and active = ?");
$sth->bind_param( 1, $postInputs{'domain_name'} );
$sth->bind_param( 2, $postInputs{'active'} );
$sth->execute();

@row=$sth->fetchrow_array();

print "<h3><center>You have successfully updated the following 
information!</center></h3>";
print "<center>Domain Name: $row[0]</center>";
print "<center>Active: $row[5]</center>";
print "</body></html>";
print "&nbsp";

>>>>>> SNIP >>>>>>>>>

If the update statement cannot run due to the domain_name not existing in the database 
I need to send an error back to the browser.  A similar thing would be if the user was 
searching for a domain such as:

select * from reg_info where domain_name = "mydomain.com"

and the domain cannot be found in the table.

Thanks,

Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Roush Industries
Office: 734-466-6286
Cell: 734-231-6769
Fax: 734-466-6939
[EMAIL PROTECTED]
====================================================
I have not lost my mind, it's backed up on tape somewhere!
====================================================

Reply via email to