[OA] Evaljrl table insert problem - fix for single student entry.

Les Richardson les at celery.richtech.ca
Fri Sep 8 22:37:07 EST 2006


Hi Methodius,

The new enrolstud1.pl script now fixes the problem of lastnames with 
commas failing on insert in the evaluation journal.

Previously I would fix the name with a simple regex:

$lastname =~ s/'/''/;

I'm now using the DBI quote function to correctly fix this problem, since 
it is likely more robust.

$lastname = $DBH->quote($lastname);


Les







On Fri, 8 Sep 2006, Methodius Dusyk wrote:

> Hi The script works OK.  The enroladd0.pl works for the "Enroll Students 
> - select subjects, by Grade" .
>
> When I enroll a single student using a student number, the enrolstud1.pl 
> script is called which complains about the an apostrophe in a students 
> name. I think that script will also need some adjusting.
>
> Methodius
>
> ________________________________
>
> From: openadmin-bounces at pananix.com on behalf of Les Richardson
> Sent: Fri 9/8/2006 12:04 PM
> To: School OpenAdmin Discussion List
> Subject: Re: [OA] Evaljrl table insert problem
>
>
>
> Hi Methodius,
>
> This is now fixed and updated in the 2.01 updates. (enroladd1.pl) Thanks
> for the heads up.
>
> Les
>
>
> On Tue, 5 Sep 2006, Methodius Dusyk wrote:
>
>> Hi
>>
>> When a school is enrolling students into subjects, and the student name
>> contains an apostrophe such as in "O'Grady" , the enroladd1.pl script
>> complains when an insert into the evaljrl table is required.
>>
>> DBD::mysql::st execute failed: You have an error in your SQL syntax;
>> check the manual that corresponds to your MySQL server version for the
>> right syntax to use near 'Grady-Blais','xxxx','xxxx','xxxx-09-23','')'
>> at line 3 at /opt/schools/bready/cgi/repcard/enroladd1.pl line 121.,
>> referer: http://brea.lskysd.ca/cgi-bin/repcard/enroladd0.pl
>>
>> The last name in this case is "O'Grady-Blais"  I replaced parts of the
>> student name and birthdate with xxxx in this email The script that
>> enrolls a student into OpenAdmin seems to have no problem with names
>> that have an apostrophe in them.
>>
>> Methodius
>>
>> _______________________________________________
>> Openadmin mailing list
>> Openadmin at pananix.com
>> https://www.pananix.com/cgi-bin/mailman/listinfo/openadmin
>>
> _______________________________________________
> Openadmin mailing list
> Openadmin at pananix.com
> https://www.pananix.com/cgi-bin/mailman/listinfo/openadmin
>
>
>


More information about the Openadmin mailing list