For some reason I can't get this to update my database and i see no problems with the script. And i get no errors in my logs.
#!/usr/bin/perl ### modify2.cgi use CGI qw/:standard/; require "common.sub"; $old_email = $ENV{QUERY_STRING}; $emp_id = &filter(param(emp_id)); $f_name = &filter(param(f_name)); $l_name = &filter(param(l_name)); $extension = &filter(param(extension)); $phone = &filter(param(phone)); $email = &filter(param(email)); $notes = &filter(param(notes)); print header; &Create_DB_Connection; &write_data; &print_output; # Disconnect from the database $dbh->disconnect; ################ BEGIN WRITE DATA SUBROUTINE sub write_data{ $SQL="UPDATE contact SET emp_id = '$emp_id', f_name = '$f_name', l_name = '$l_name', extension - '$extension', phone = '$phone', email = '$email', notes = '$notes' WHERE email = '$old_email' "; &Do_SQL; } # End of write_data ################ END WRITE DATA SUBROUTINE ################ BEGIN PRINT OUTPUT SUBROUTINE sub print_output{ print<<HTML; <HTML><BODY BGCOLOR="#F1EDD3"> <CENTER><FONT SIZE=5 FACE=ARIAL> Record modified in database <P> <A HREF="http://somewhere.com/nick/dev/index.html">Return to Main +Page</A> </P> </FONT></CENTER> </BODY></HTML> HTML } # End of subroutine ################ END PRINT OUTPUT SUBROUTINE
Thanks

In reply to PostgreSQL UPDATE by nlafferty

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.