Thanks#!/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
In reply to PostgreSQL UPDATE by nlafferty
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |