in reply to Re: Re: MySQL Database Check...
in thread MySQL Database Check...

I did specify it was MySQL specific (and yes it does work ;-) but as you state using the DBI table methods or even just wrapping in an eval or changing RaiseError will be more portable options.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Re: Re: MySQL Database Check...
by powerhouse (Friar) on Jan 02, 2003 at 06:36 UTC
    Well, thanks guys. After I posted, I was playing around with it, and I remembered a few things...

    Here is how I got it to work.

    $sth = $dbh1->selectrow_array ( "SELECT * FROM `some_table_name` LIMIT 1"); if ($dbh1->errstr) { #Does not exist } else { # DOES exist }

    I used LIMIT 1 in case it does exist and has thousands of entries. This way it will be faster, if it does exist. Otherwise it don't matter.

    It worked for what I was wanting it to do.

    thx,
    Richard