Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. wixsas

    Knowing which cookie to use???

    The sessionid (cartID) is the primary key in the database and the value in the cookie.
  2. wixsas

    Knowing which cookie to use???

    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.
  3. wixsas

    Knowing which cookie to use???

    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...
  4. wixsas

    Knowing which cookie to use???

    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)...
  5. wixsas

    is it possible to store an array in a sql database??

    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.
  6. wixsas

    is it possible to store an array in a sql database??

    An example of what $cookie and $songs hold is $cookie : 186795506 $songs : Forest.mp3
  7. wixsas

    is it possible to store an array in a sql database??

    LOL wat was pink floyd thinking? Putting that aside could someone please help me??? :P
  8. wixsas

    is it possible to store an array in a sql database??

    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
  9. wixsas

    is it possible to store an array in a sql database??

    this is was how i created the table: (cartID CHAR(200) NOT NULL, song CHAR(200) NOT NULL); That should be right shouldn't it???
  10. wixsas

    is it possible to store an array in a sql database??

    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)...
  11. wixsas

    is it possible to store an array in a sql database??

    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")...
  12. wixsas

    is it possible to store an array in a sql database??

    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 =...

Part and Inventory Search

Back
Top