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().