sigh! The code, which isn't working is:
# if a syllabus was attached
if($query->param('syllabus')) {
while($bytesread = read($query->param('syllabus'),$buffer,1024)) {
$syllabus .= $buffer;
}
$sylName = $query->param('syllabus');
$sylName =~ s/.*\/\\(.*)/$1/;
}
$sql = "INSERT INTO class_info(title, instructor, inst_email, " .
"active,max_students, description,syllabus,begin_date, " .
"syll_name,begin_time,class_length) VALUES('" .
$query->param('title') . "','" .
$query->param('name') . "','" . $query->param('email') . "',1," .
$maxstud . ",'" . $query->param('description') . "'," .
$syllabus . ",'" .
$query->param('year0') . "-" . $query->param('mon0') . "-" .
$query->param('day0') . "','" . $sylName . "'," .
"SEC_TO_TIME(TIME_TO_SEC('" . $query->param('classtime') . "') + " .
$timeadj . ")," . $query->param('lengthofclass') . ")";
$dbh->do("INSERT INTO class_info(title, instructor, inst_email, " .
"active,max_students, description,syllabus,begin_date, " .
"syll_name) VALUES('" . $query->param('title') . "','" .
$query->param('name') . "','" . $query->param('email') . "',1," .
$maxstud . ",'" . $query->param('description') . "'," .
$syllabus . ",'" .
$query->param('year0') . "-" . $query->param('mon0') . "-" .
$query->param('day0') . "','" . $sylName . "'" .
"SEC_TO_TIME(TIME_TO_SEC('" . $query->param('classtime') . "') + " .
$timeadj . ")," . $query->param('lengthofclass') . ")";
|| die $sql . "\n" . $dbh->errstr;
In reply to Re: DBI file input to blob
by amracel
in thread DBI file input to blob
by amracel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |