Gossamer Forum
Quote Reply
$error
   

Hi,

I have been trying to work out why I only get one error message on my modify page when I should get one for each error. If a user was to blank out some required fields, it appears that DBsql Home.pm sub modify_record only generates one error using my $error = $self->{db}->error; e.g

"Column field_name1 cannot be left blank."

instead of

"Column field_name1 cannot be left blank.

Column field_name2 cannot be left blank.

Column field_name3 cannot be left blank. etc."


On my add page I get an error message for each required field that is not entered. The errors are generated in DBsql Home.pm sub add_record using the code my $error = $GT::SQL::error; This works fine.

Has anyone else noticed this or have I changed something?

Shouldn't both subs use my $error = $GT::SQL::error; ????


Thanks

Simon.
Quote Reply
Re: [jai] $error In reply to
Any ideas??????
Quote Reply
Re: [jai] $error In reply to
Just replace:
my $error = $self->{db}->error;

with:

local $^W;
my $error = $GT::SQL::error;

It should work.

TheStone.

B.

Last edited by:

TheStone: Apr 11, 2002, 5:10 PM