#!/usr/local/bin/perl ############################################################################# # List the ice cream orders - using database ############################################################################# use DBI; $dbh = DBI->connect("DBI:mysql:demo","demo","demo"); #$dbh = DBI->connect("DBI:mysql:demo:db.it.scps.nyu.edu:3300","demo","demo"); print "Content-type: text/html \n"; print "\n"; print " List all orders

List of all ice cream orders:

"; $sql = "select * from ice_orders"; $cursor = $dbh->prepare($sql); $rc = $cursor->execute(); while( @columns = $cursor->fetchrow_array() ) { ($id,$fname,$address,$flavor) = @columns; print ""; } print "
NameAddressIce Cream Flavor
$fname $address $flavor
"; $dbh->disconnect(); exit(0);