I am am to create the table inside the database witht he information gathered in the CGI form. However, I cannot get the database to read the information from the file.
$UserFile is something like c:\bla.txt --obviously linux does not understand this and I need a way to send the file directly from my machien to mysql. What dfo I need to do?
#====> sql commands
my $sth = $dbh->prepare("CREATE TABLE $TableName ($SQLString)") or bla
+, bla bla;
$sth->execute or bla, bla bla;
my $sth = $dbh->prepare("LOAD DATA INFILE $UserFile INTO TABLE $Table
+Name") or bla, bla bla;
$sth->execute or bla, bla bla;
#====> form used to get info...
sub generate_form {
# Create the form
print start_form(-method=>'POST');
print center(
table( {-border => 0},
Tr( {-align=>'left', -valign=>'top'}, td("<B>Log File to import:")
+, td(filefield(-name=>'LogFile',
-default=>'', -size=>50, -maxlength=>50)) ),
Tr( {-align=>'left', -valign=>'top'}, td("<B>Database name:"), td(
+textfield(-name=>'DBName',
-default=>'', -size=>50, -maxlength=>50)) ),
Tr( {-align=>'left', -valign=>'top'}, td("<B>Database user:"), td(
+textfield(-name=>'DBUser',
-default=>'', -size=>50, -maxlength=>50)) ),
Tr( {-align=>'left', -valign=>'top'}, td("<B>Database password:"),
+ td(textfield(-name=>'DBPassword',
-default=>'', -size=>50, -maxlength=>50)) ),
Tr( {-align=>'left', -valign=>'top'}, td("<B>Table name:"), td(tex
+tfield(-name=>'TableName',
-default=>'', -size=>50, -maxlength=>50)) ),
Tr( {-align=>'center', -valign=>'top'}, td({-colspan=>3}, submit('
+action', 'Add addess')))
) # end: table()
); # end: center()
print end_form();
}
I appreciate your help. I have searched site, but nothing I can find directly relates to what i am trying to do...Perhaps I cannot see the forest for the trees...