Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

add_success shows first row of table, not row just added

Quote Reply
add_success shows first row of table, not row just added
When I add a row to a table, the add_success.html template purports to show me the record I just added, but instead always shows the first row in the table.

In Dbsql::Home::add_record(), there is this:

if ( defined (my $ret = $self->{db}->add($self->{cgi})) ) {
$self->auth_logging('add record ') if ( $self->{cfg}->{log_file} );

#------------demo code-----------

$self->add_success($ret);
}

Now, if $self->{db}->add() is supposed to return something sensible all the time, so add_success() can use it to display the record just added, then this ought to work. But in the documentation for GT::SQL::Table::add(), it says it returns 1 unless one has just added something to an auto-increment table (which I have not, in this case); or undef on error.

Am I missing something? Isn't this a plain bug in DbmanSQL? Can someone suggest some replacement code?
Subject Author Views Date
Post add_success shows first row of table, not row just added jxh 2034 Nov 2, 2003, 5:37 PM