CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Storing an array in an sql database

 



wicksy
Novice

May 22, 2007, 9:00 PM

Post #1 of 1 (275 views)
Storing an array in an sql database Can't Post

Hi just wondering if it was possible to store an array in an sql database???
Here is my code:


Code
  my @ListOfSongs = param("songs"); 

my $dbh = DBI->connect("DBI:SQLite:sessions.db")
or die "Cannot connect: " . $DBI::errstr;

$sth = $dbh->prepare("UPDATE sessions SET contents = @ListOfSongs WHERE cartID = $cookie")
or die "Cannot prepare";
$sth->execute() or die "Cannot execute";


As you can see i have an array called @ListOfSongs which holds song titles. I want to store it in the array so that i can then pull it out later when it is needed.

Cheers

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives