I need help on testing the database for errors. Basically im writing a perl
script to operate my database. When i open the database, i need it to return
an error code if successful. steps such as:

open database
check for error (did database open?)
if error print error message
else print successful.
close database


use DBI
$dbh = DBI->connect("DBI:mysql:dbname","user","password");
$sth = $dbh->prepare("SELECT username from MyTable");

(error checking here)

$sth->execute;
$dbh->disconnect;

Basically on the error checking part, if successful $errorcode = 0 or if
there is error $errorCode = 1;



Thank all,
Marbeen  Felipe






---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to