A handy way of capturing data with a browser and inserting into MySQL via form submit. Pulling the captured data from MySQL and displaying it with a browser is just as easy.
#!/usr/bin/perl useCGIqw(:standard);useDBI;print<<END;Content-type:text/html<html><head><title>TVEpisodecaptureForm</title></head><bodybgcolor="white">END# database connection info $db="tv";$host="localhost";$userid="mysql_username";$passwd="mysql_password";$connectionInfo="dbi:mysql:$db;$host";$tvshow=param('tvshow');$shownumber=param('shownumber');$showtitle=param('showtitle');$aired=param('aired');$overview=param('overview');$year=param('minutesstart');$month=param('yearstop');$day=param('monthstop');# connect to database $dbh=DBI->connect($connectionInfo,$userid,$passwd);# prepare and execute query $query="INSERT INTO episodeguide (tvshow,shownumber,showtitle,aired,overview) VALUES(\"$tvshow\",\"Episode $shownumber\",\"$showtitle\",\"$aired\",\"$overview\");";$sth=$dbh->prepare($query)||die"Could not prepare SQL statement ... maybe invalid?";$sth->execute()||die"Could not execute SQL statement ... maybe invalid?";# assign fields to variables $sth->bind_columns(\$ID,\$tvshow,\$shownumber,\$showtitle,\$aired,\$overview);# output thanks message to browser print"<b>Your entry was sucessfully captured in the database!</b><p>\n";print"</table>\n";print"</body>\n";print"</html>\n";$sth->finish();# disconnect from database $dbh->disconnect;sub fail{print"<title>Error</title>","<p>ERROR: An error ocured, please try again!</p>";exit;}