# HelloMySQL.pl # # MySQL STARTS HERE use strict; use CGI qw(:standard); use DBI; #MySQL CONFIG VARIABLES $host = "ftp here"; $database = "dbname here"; $tablename = "tablename here"; $user = "userid here"; $pw = "pw here"; # CONNECT TO DB $db = DBI->connect($host, $database, $user, $pw); # SELECT DB $db->selectdb($database); # DEFINE A MySQL QUERY $myquery = "INSERT INTO $tablename (fname, lname, street, city, state, zip, email, age) VALUES ('fname1,'lname1','street1', 'city1', 'state1', 'zip1', 'email1', 'age1')"; # EXECUTE THE QUERY FUNCTION $execute = $connect->query($myquery); $execute->execute(); # CLOSE DB CONNECTION $db->disconnect(); exit;