List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:April 28 2000 6:13pm
Subject:Re: locking and unlocking a mysql database using perl and DBI (multiple
tables)
View as plain text  
Vicki Youll wrote:

> Hi,
>
>  I have used this syntax below, however i  am still having problems! I am using a
> mysql database with  DBI as the interface.  While testing my program i am
> receiving the error message - "Can't call method "do" without a package or object
> reference" from the web server..
> Any suggestions??
>
>
> sub insert_db_data($) {
>   my $dbh = @_;
>   my $card_accepted = "no";
>   my $lock_sql = "LOCK TABLES members WRITE, payment WRITE, authentication WRITE";
>   my $unlock_sql = "UNLOCK TABLES";
>
>       $lock = $dbh->do($lock_sql);
>       $dbh->do("INSERT INTO
> members(NAME,SURNAME,ADDRESS,ADDRESS1,CITY,COUNTRY,ZIP_CODE,DOB,TELNUMBER,EMAIL) VALUES
> (?,?,?,?,?,?,?,?,?,?)",$firstname,$surname,$address,$address1,$city,$country,$postcode,$dob,$telnumber,$email);
>       $dbh->do("INSERT INTO payment(CARD_TYPE,CARD_NUMBER,CARD_NAME,EXPIRY) VALUES
> (?,?,?,?)",$cardtype,$cardnumber,$cardname,$expiry);
>       $dbh->do("INSERT INTO authentication(CARD_ACCEPTED,LOGIN,PASSWORD) VALUES
> (?,?,?)",$card_accepted,$login,$password);
>       $unlock = $dbh->do($unlock_sql);
> }
>
> thanks
>
> Vicki Youll

$dbh is not a valid, open database handle.
Maybe you did not check the results of the connect?
Maybe you passed more than one value to insert_db_data().


Thread
locking and unlocking a mysql database using perl and DBI (multiple tables)Vicki Youll28 Apr
  • Re: locking and unlocking a mysql database using perl and DBI(multiple tables)Michael Bacarella28 Apr
  • Re: locking and unlocking a mysql database using perl and DBI (multiple tables)Gerald Clark28 Apr
  • Re: locking and unlocking a mysql database using perl and DBI (multiple tables)Thimble Smith29 Apr
    • RE: locking and unlocking a mysql database using perl and DBI (multiple tables)benjamin-weiss29 Apr
    • Re: locking and unlocking a mysql database using perl and DBI (multiple tables)(Harald Fuchs)29 Apr
RE: locking and unlocking a mysql database using perl and DBI (multiple tables)J.M.)29 Apr
  • Re: locking and unlocking a mysql database using perl and DBI (multiple tables)sasha29 Apr
Re: locking and unlocking a mysql database using perl and DBI (multiple tables)Vicki Youll1 May