Why won't this perl command execute?

martinthurn

New member
The variable you are calling "prepare" on is $dbh. Therefore, it's saying that $dbh is undefined.
BTW the return value of prepare() is a statement handle, so you should call the variable something like $sth instead of $sqlQuery.
 
The variable you are calling "prepare" on is $dbh. Therefore, it's saying that $dbh is undefined.
BTW the return value of prepare() is a statement handle, so you should call the variable something like $sth instead of $sqlQuery.
 
The variable you are calling "prepare" on is $dbh. Therefore, it's saying that $dbh is undefined.
BTW the return value of prepare() is a statement handle, so you should call the variable something like $sth instead of $sqlQuery.
 
$sqlQuery = $dbh->prepare($query)
or die "Can't prepare $query: $dbh->errstr\n";

It states that it cannot call method "prepare" on an undefined variable
 
The variable you are calling "prepare" on is $dbh. Therefore, it's saying that $dbh is undefined.
BTW the return value of prepare() is a statement handle, so you should call the variable something like $sth instead of $sqlQuery.
 
Back
Top