List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 15 2002 2:39am
Subject:Re: DBI or CGI perl error?
View as plain text  
At 20:34 -0600 12/14/02, Vidiot wrote:
>My database layout is as follows:
>
>mysql> show columns from music;
>+-----------+---------------+------+-----+---------+-------+
>| Field     | Type          | Null | Key | Default | Extra |
>+-----------+---------------+------+-----+---------+-------+
>| mrecno    | int(6)        |      | PRI | 0       |       |
>| title     | varchar(45)   |      |     |         |       |
>| artist    | varchar(30)   |      |     |         |       |
>| source    | char(1)       |      |     |         |       |
>| peak      | int(3)        | YES  |     | NULL    |       |
>| peakdate  | date          | YES  |     | NULL    |       |
>| entrydate | date          | YES  |     | NULL    |       |
>| length    | int(3)        | YES  |     | NULL    |       |
>| stereo    | char(1)       | YES  |     | NULL    |       |
>| cut       | tinyint(1)    |      |     | 0       |       |
>| album     | varchar(45)   | YES  |     | NULL    |       |
>| trackno   | int(2)        | YES  |     | NULL    |       |
>| notes     | varchar(40)   | YES  |     | NULL    |       |
>| mcreated  | date          | YES  |     | NULL    |       |
>| mamended  | timestamp(14) | YES  |     | NULL    |       |
>+-----------+---------------+------+-----+---------+-------+
>
>Yet I get the following error:
>
>Error
>
>The Database Routines returned the following error
>The reason given was:
>updating music - You have an error in your SQL syntax near 'mamended 
>= '20021214013349' where mrecno = '1' ' at line 2
>The command being executed was:
>
>update music
>  set  cut = '' mamended = '20021214013349' where mrecno = '1'

The problem here is the lack of a comma between cut = '' and
mamended = 20021214013349'.  The statement is malformed, it
has to fail.  It's not a DBI error *or* a CGI error.

>
>I get it when I do a web page reload.  Two things are wrong: 1) cut is defined
>as an integer, yet it is trying to store nothing, while the default is set
>to zero and nothing should be attempted to the mamended field, as that is an
>auto-update field from within MySQL.
>
>The following are the RPMs that I have installed on my Linux 7.1 system:
>
>	MySQL-3.23.53a-1.i386.rpm
>	MySQL-Max-3.23.53a-1.i386.rpm
>	MySQL-client-3.23.53a-1.i386.rpm
>	MySQL-devel-3.23.53a-1.i386.rpm
>	MySQL-shared-3.23.53a-1.i386.rpm
>	perl-DBD-MySQL-1.2215-1.i386.rpm
>	perl-DBI-1.14-10.i386.rpm
>
>The Perl CGI package was part of the Perl 5.0.6 installation.
>
>Any pointers/suggestions will be greatly appreciated.
>
>Thanks.
>
>MB
>--
>e-mail: vidiot@stripped                          /~\ The ASCII
>                                                    \ / Ribbon Campaign
>	                                            X  Against
>Visit - URL: http://vidiot.com/                    / \ HTML Email
>

Thread
DBI or CGI perl error?Vidiot15 Dec
  • Re: DBI or CGI perl error?Paul DuBois15 Dec
  • RE: DBI or CGI perl error?Peter Lovatt15 Dec