WODA: FAQs

 Data Management

How do I know when new records are added to my web database?

I found a better solution for woda4.

$WBB{'requireFile'} = '/Absolute Path to the
webserver/cgi-bin/woda/uk/cgiDB_Update.pm';
$WBB{'afterTableModify'} = '&DB_UPDATE($rec{_id})';

Notice
^

Then the sub DB_UPDATE in the file cgiDB_Update.pm:

sub DB_UPDATE {
my $recId = shift;

$|=1;
undef %rec;
&recRead($recId, 'table_name');

open(MAIL, "| /usr/lib/sendmail -t") || die "Can't open sendmail!\n";
print MAIL <<EOM;
From: $WBB{'managerEmail'}
Bcc: $WBB{'managerEmail'}
Subject: Database Change
To: $Distribution

The record #$recId was modified.
The new content is listed below.

Thanks,
$WBB{'manager'}.

------------------------------------------------------

EOM
print MAIL %rec, "\n";
print MAIL "\n";
close MAIL;

print <<EOM;
Your change was stored in the Database,
and send by E-Mail to the distribution list.

<CENTER><FORM>
<INPUT TYPE=BUTTON VALUE=Back onClick='window.close();'>
</FORM></CENTER>
EOM
}

Good luck,
Jean-Paul

modify the informationdelete entire recordexplain the meaning of the fieldsbrowse recordsAdd a new questionHome page of this databaselogin Valid HTML 4.01 Transitional Valid CSS! Powered by WODA 4.6x trunk