Gossamer Forum
Home : Products : DBMan : Customization :

Using DBMan to track a promotion

Quote Reply
Using DBMan to track a promotion
I was looking at using dbman to track sales in a sales promotion. I want the client to be able to enter their sales in a field (50, 75 , 100 etc) I want the script to be able to total their sales. As of todays date you have 225 points.

Would it be possible to save the total as a new field so we can track the clients with the most points?

Thanks

Sean

Quote Reply
Re: Using DBMan to track a promotion In reply to
Depends on your server's data processors and memory. If you have tons of CPU and Memory, you could dynamically show the totals...which may be better...

Simply put the following codes in the sub html_record routine (or sub html_record_long if you are using the Short/Long Display Mod)....

Code:

my $total = $rec{'FieldName'} + $rec{'FieldName2'} + $rec{'FieldName3'};
print qq|
Totals for Today: $total
|;


The problem with using a "static" total field is that you would have to add a bunch for each day that you want to see a set of totals, and there are limits to the number of fields you can use in a flat file system like DBMAN, which is around 150 fields for most web servers.

Regards,

Eliot Lee
Quote Reply
Re: Using DBMan to track a promotion In reply to
You may want to check the FAQ noted below in the section "Calculate / Counts" and also under "Viewing"

I think you will get some ideas to come up with a working solution.

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/