Database Reference
In-Depth Information
member_adjust_expiration.plx Hollar
List of Members - 'Hollar'
Lexi Hollar (4) - 2013-09-22
The program can be run again with a new expiration date for the member like so:
member_adjust_expiration.plx Hollar 4 2015-06-30
Notice that the program is expecting three values. If it receives only one value, the mem-
ber's last name, it executes the SELECT statement and displays the user information. If it
receives three values, it will execute the UPDATE statement. Values must be in the correct
order and format. The program will display a message indicating whether it's successful
in changing the membership expiration date.
You could write this program in more elaborate ways. You could allow the user to select a
date, or the number of months or years to add to the expiration date using date functions.
You could change it to run through a web interface using the CGI Perl module so that the
user can click choices instead of typing them at the command line. However, this simple
program gives you a good idea of how to get started writing a Perl API to interface with
MySQL.
More Information
To learn aboutPerl, see Learning Perl (O'Reilly) by Randal Schwartz, brian d foy, and
Tom Phoenix. For more details on using the Perl DBI with MySQL, see Alligator Des-
cartes and Tim Bunce's Programming the Perl DBI (O'Reilly). To learn more about Perl
references and other advanced Perl topics, see Intermediate Perl (O'Reilly) byRandal
Schwartz.
Search WWH ::




Custom Search