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...

In reply to Using SQL LOAD DATA INFILE via CGI by sdyates

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.