CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
posting to a MS SQL Database

 



sbee
Deleted

May 27, 2000, 2:38 PM

Post #1 of 1 (706 views)
posting to a MS SQL Database Can't Post

I have written another perl script! Alas I am still struggling! I am trying to now write data to an MSSQL database from a form. I have roughly worked it out, but I have no clue of the SQL syntax under perl! here is my script! Please help!

#!/usr/local/bin/perl -w
use Win32::ODBC;
my($db) = new Win32::ODBC("dsn=infrastructure; uid=zzeurcgiforms; pwd=zzeurcgiforms");


use CGI qw(:standard);
$firstname = param('firstname');
$lastname = param('lastname');
$cost = param('cost');

$db->SQL ("INSERT into new-joiner" ('firstname', 'lastname', 'cost') values ('$firstname', '$lastname', $cost));

#$db->$Sql;

$db->Close();


print header;
print start_html('Message Update');
print "<P>The message was: <BLOCKQUOTE><P><I>$firstname - $lastname- $cost</I></BLOCKQUOTE>\n";
print "</p> \n";
print "<div align=right><font size=2 face=Verdana, Arial, Helvetica, sans-serif><a href=index.html>IT Home Page</a></font></div>\n";
print end_html;

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives