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
In reply to Syntax errors with Win32::ODBC? by CodeNewbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |