On Mon, Mar 12, 2001 at 01:33:25PM -0500, Mitch Clarvit wrote:
> I have no problem connecting to an Oracle 8.1.5 database on Netware 5.1 and
> viewing the contents of the database, however, add or editing are causing me
> problems.

>       $sql = "INSERT INTO courses (CourseID, Title, Fees, Hours, CEUs,
> CourseDays, CourseDates,  CourseTimes, Location, Room, Instructor,
> Community) VALUES (\'$courseid\', \'$title\', \'$fees\',  $hours, $ceus,
> \'$days\', \'$dates\', \'$times\', \'$location\', \'$room\',
> \'$instructor\',  \'$community\');";
                                  ^^^

As stated in the trace output which you attached, there is a syntax error
in your SQL.  Specifically, the semicolon at the end of the SQL statement
should be removed.


Note that you should be using placeholders or DBI's quote() method rather
than interpolating your values directly into the string, which could cause
other problems down the road.


BTW, it is not necessary to put a backslash before a single quote inside a
double quoted string.


>     -> prepare for DBD::ODBC::db (DBI::db=HASH(0xcf74171c)~0xcf74174c 'INSERT INTO 
>courses (CourseID, Title, Fees, Hours, CEUs, CourseDays, CourseDates, CourseTimes, 
>Location, Room, Instructor, Community) VALUES ('GFNUPC103', 'Access 2000 
>Introduction', '$149', 12, 1.2, '4 Tues & 4 Thurs', 'Feb 6 - Mar 1', '5:00 - 6:30 
>pm', 'Boca Raton Campus ', ' ', ' ', 'smartIT');')
>     dbd_st_prepare'd sql f-893011600
>       INSERT INTO courses (CourseID, Title, Fees, Hours, CEUs, CourseDays, 
>CourseDates, CourseTimes, Location, Room, Instructor, Community) VALUES ('GFNUPC103', 
>'Access 2000 Introduction', '$149', 12, 1.2, '4 Tues & 4 Thurs', 'Feb 6 - Mar 1', 
>'5:00 - 6:30 pm', 'Boca Raton Campus ', ' ', ' ', 'smartIT');
>     <- prepare= DBI::st=HASH(0xcf74183c) at addcourse.pl line 79.
>     -> execute for DBD::ODBC::st (DBI::st=HASH(0xcf74183c)~0xca4243b4)
>     dbd_st_execute (for sql f-893011600 after)...
>     ERROR EVENT -1 '[TOD][ODBC][SQLI]%PARSER-E-SYNTAX, Line 5 Syntax Error: Last 
>Symbol Read Was hours (SQL-S1000)(DBD: st_execute/SQLExecute err=-1)' (Handlers: 
>undef)


HTH!
Ronald

Reply via email to