poolboi has asked for the wisdom of the Perl Monks concerning the following question:
and i got say 2 fields User and Time i tried using this code@array1 = [ 1 ,2 , 3]; @array2 = [4, 5, 6];
i got the results like:foreach $user(@array1){ $sth -> $dbh ->perpare("INSERT INTO `trial` (User) VALUES ('$user')"); $sth->execute(); foreach $time(@array2){ $sth -> $dbh ->perpare("INSERT INTO `trial` (Time) VALUES ('$time')"); $sth->execute();
how should i change or input my code so i can get this in the databaseUser Time 1 NULL 2 NULL 3 NULL NULL 4 NULL 5 NULL 6
User Time 1 4 2 5 3 6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inserting 2 arrays into 2 field in MySQL
by ikegami (Patriarch) on May 15, 2008 at 04:08 UTC | |
by poolboi (Acolyte) on May 15, 2008 at 05:48 UTC | |
by chrism01 (Friar) on May 15, 2008 at 06:04 UTC | |
by ikegami (Patriarch) on May 15, 2008 at 14:47 UTC | |
|
Re: Inserting 2 arrays into 2 field in MySQL
by pileofrogs (Priest) on May 15, 2008 at 04:36 UTC |