|
Spring Semester 2007 |
DBI.pm to implement sessions in CGI with Perl Try these scripts (make sure they work) in your accounts:
It's OK if for the time being you make these work with my database.
Here's what tables I use:
Now about the sample midterm.mysql> describe dgerman_accumulator; +------------+-----------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-----------+------+-----+-------------------+-------+ | session_id | char(8) | NO | PRI | | | | acc | int(11) | YES | | NULL | | | modified | timestamp | YES | | CURRENT_TIMESTAMP | | +------------+-----------+------+-----+-------------------+-------+ 3 rows in set (0.00 sec) mysql> describe dgerman_guessTheNumber; +------------+--------------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+-------------------+-------+ | session_id | char(8) | NO | PRI | | | | message | varchar(120) | YES | | NULL | | | secret | int(11) | YES | | NULL | | | attempts | int(11) | YES | | NULL | | | won | int(11) | YES | | NULL | | | lost | int(11) | YES | | NULL | | | modified | timestamp | YES | | CURRENT_TIMESTAMP | | +------------+--------------+------+-----+-------------------+-------+ 7 rows in set (0.00 sec) mysql>
Here's a working version of the program (see page 66 in the book).
Here's the code for:
I will demo them and discuss them in class.