I want to carry out table retrieval only if a table exists. Currently I'm carrying out the call unconditionally and it's not going on to the next bit of code.
This is what I want to do but ONLY if the table exists :-
use DBI;
use CGI qwstandard);
local ($dbh, $sth);
$dbh = DBI->connect ("DBI:mysql:host=server;database=database",
"database", "password", {PrintError => 0, RaiseError => 1});
$sth = $dbh->prepare ("SELECT * FROM TableData"
$sth->execute ();
while (my @RetrievedData = $sth->fetchrow_array ()) {
do something
}
Any Help please ?
This is what I want to do but ONLY if the table exists :-
use DBI;
use CGI qwstandard);
local ($dbh, $sth);
$dbh = DBI->connect ("DBI:mysql:host=server;database=database",
"database", "password", {PrintError => 0, RaiseError => 1});
$sth = $dbh->prepare ("SELECT * FROM TableData"
$sth->execute ();
while (my @RetrievedData = $sth->fetchrow_array ()) {
do something
}
Any Help please ?