Hi all,
I want connect a database of this program :
#!/usr/bin/perl -w
use DBI;
$user ="romeo";
$driver = "DBI:mysql:romeo";
$password = "123456";
$dbh =DBI->connect($driver,$user,$password) or die "\n Eroare ($DBI::err): $DBI::errstr\n";
$first = "firstname";
$second = "lastname";
$statement = $dbh->prepare("SELECT $first, $second FROM users") or die "\n Eroare ($DBI::err):$DBI::errstr\n";
$statement->execute or die "\n Eroare ($DBI::err): $DBI::errstr\n";
print "\n \n Returnare $first si $second \n";
while(($firstname, $lastname) = $statement->fetchrow_array){
print "$firstname\t $lastname\n";
}
$statement->finish;
$dbh->disconnect;
#####################################
the problem is this error:
"DBD :: mysql :: st execute failed: Table 'romeo.users' doesn't exist at db line 14 ERROR (1046):Table:'romeo.users' doesn't exist"
the fields exist in this database, and datasource and user and password is declare
best regards,
dontu
I want connect a database of this program :
#!/usr/bin/perl -w
use DBI;
$user ="romeo";
$driver = "DBI:mysql:romeo";
$password = "123456";
$dbh =DBI->connect($driver,$user,$password) or die "\n Eroare ($DBI::err): $DBI::errstr\n";
$first = "firstname";
$second = "lastname";
$statement = $dbh->prepare("SELECT $first, $second FROM users") or die "\n Eroare ($DBI::err):$DBI::errstr\n";
$statement->execute or die "\n Eroare ($DBI::err): $DBI::errstr\n";
print "\n \n Returnare $first si $second \n";
while(($firstname, $lastname) = $statement->fetchrow_array){
print "$firstname\t $lastname\n";
}
$statement->finish;
$dbh->disconnect;
#####################################
the problem is this error:
"DBD :: mysql :: st execute failed: Table 'romeo.users' doesn't exist at db line 14 ERROR (1046):Table:'romeo.users' doesn't exist"
the fields exist in this database, and datasource and user and password is declare
best regards,
dontu