JackTheRussel
Programmer
Hi !
Could someone help me with this:
I make sql-query (select name from table) and
there should be come data like: (Kevin, John, Mark..)
Now I would like to put these results to the table named
my @names;
My code is:
Now if I try to print some values:
print $names[0];
print $names[1];
Results are:
$names[0] = Kevin
$names[1] = Use of uninitialized value in print at ./Application.pl line 29.
So What I have to do that I get all result to the table @names ?
Please some one....
Could someone help me with this:
I make sql-query (select name from table) and
there should be come data like: (Kevin, John, Mark..)
Now I would like to put these results to the table named
my @names;
My code is:
Code:
my $db_conn = DBI->connect($dsn, $db_username, $db_password);
$sql_string = "select name from table";
$sth = $db_conn->prepare($sql_string);
$sth->execute;
@names = $sth ->fetchrow_array;
$sth->finish();
Now if I try to print some values:
print $names[0];
print $names[1];
Results are:
$names[0] = Kevin
$names[1] = Use of uninitialized value in print at ./Application.pl line 29.
So What I have to do that I get all result to the table @names ?
Please some one....
