CodeNewbie has asked for the wisdom of the Perl Monks concerning the following question:
syntax error at line 37, near "people values" Bad name after first_name' line 37.
Any help or advice would be greatly appreciated.
use Win32::ODBC; print "Content-type: text/html\n\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>Testing Database Code</TITLE>\n"; print "</HEAD>\n"; print "<BODY bgcolor=\"ffffcc\">\n"; $DSN="CodeTestMySQL"; if (!($db=new Win32::ODBC($DSN))) { print "Error connecting to $DSN\n"; print "Error: " . Win32::ODBC::Error() . "\n"; } else { print "Information being added to the University of Minnesota Fed +eral Small Business Self-Certification Database.<br><br><br>\n"; } $currentdate = ¤tdate; $SqlStatement = insert into people values('$FORM_DATA{'first_name'}',' +$FORM_DATA{'last_name'}','$currentdate'); sub currentdate { local $currentdate = $FORM_DATA{'year'}."-".$FORM_DATA{'month'}."-". +$FORM_DATA{'day'}; return $currentdate; } if ($db->Sql($SqlStatement)) { print "SQL failed.\n"; print "Error: " . $db->Error() . "\n"; }
Edit kudra, 2002-05-17 Added to title, added p
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntax errors?
by JayBonci (Curate) on May 16, 2002 at 19:33 UTC | |
|
Re: Syntax errors?
by derby (Abbot) on May 16, 2002 at 19:39 UTC | |
by CodeNewbie (Initiate) on May 16, 2002 at 20:06 UTC |