ynotlim
09-09-2006, 01:41 AM
I have the following array. These major codes are now in a DB. How do I store them into the array from the DB??
@major_list = ( "77279", "60014", "65063", "97068", "60093", "5744D", "57000",
"60100", "55120", "77289", "7728B", "77294", "62153", "0616A", "60469",
"77284", "60169", "60174", "60192", "77302", "95201", "77193", "95193",
);
here is what I have so far. but it doesn't work.
@major_list;
$dbh = DBI->connect('DBI:....)
or warn "Unable to open: $DBI::errst \n";
$con = $dbh ->prepare(select major_code from major
where active=1 order);
$con ->execute;
while ( @columns = $cursor->fetchrow ) {
@ws = ( map {"$_"} @columns);
@major_list=($ws[0]);
}
$con->finish;
$dbh->disconnect;
Thanks in advance
Tony
@major_list = ( "77279", "60014", "65063", "97068", "60093", "5744D", "57000",
"60100", "55120", "77289", "7728B", "77294", "62153", "0616A", "60469",
"77284", "60169", "60174", "60192", "77302", "95201", "77193", "95193",
);
here is what I have so far. but it doesn't work.
@major_list;
$dbh = DBI->connect('DBI:....)
or warn "Unable to open: $DBI::errst \n";
$con = $dbh ->prepare(select major_code from major
where active=1 order);
$con ->execute;
while ( @columns = $cursor->fetchrow ) {
@ws = ( map {"$_"} @columns);
@major_list=($ws[0]);
}
$con->finish;
$dbh->disconnect;
Thanks in advance
Tony