I am storing the sessions in a database on the server side but that is not the issue.
All i want to know is what i can use in that IF statement to check which user the cookie relates to.
Yeh i did try that but because the username is only entered once as soon as i press a submit button for a form inside the website it resets the $username to null. Which means from then on everytime i try to retrieve the cookie value ie: $cookie = q->cookie($username) it can't get to it because...
Hi I'm currently writing a shopping cart style program which allows users to login , purchase songs and then logout with their balance being decremented depending on whether they purchased anything. I have a database called sessions.db which keeps track of their cookie id (a random number)...
Have changed cartID to an INTEGER but still doesnt work. If i put '' around the ? marks then i get a "Cannot execute" error which is what i have specified it to say when it errors.
If i don't put the '' around the ? i get a "unknown named parameter" error.
Hi I think i'd rather use the method I am using now. That is creating a new record for each song.
Can anyone tell me why $songs will not work when i try and pass it in?? BTW I have changed the CHARS to (30) and (30) respectively... LOL
Hey guys thanks for your responses. It all makes sense and I will make those changes. But it is still giving me an error on the execute line now.
$sth = $dbh->prepare("INSERT INTO songs (cartID, song) VALUES (?, ?)") or die "Cannot prepare";
foreach $songs (@ListOfSongs)...
Hi thanks heaps for the help. That will work perfectly however in the implementation of that I have come across a problem.
Here is my code :
my $cookie = $q->cookie('cart_id');
my @ListOfSongs = param("songs");
my $sizeOfArray = 0;
my $dbh = DBI->connect("DBI:SQLite:songs.db")...
Hi just wondering if it was possible to store an array in an sql database???
Here is my code:
my @ListOfSongs = param("songs");
my $dbh = DBI->connect("DBI:SQLite:sessions.db")
or die "Cannot connect: " . $DBI::errstr;
$sth =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.