Gossamer Forum
Home : Products : DBMan : Customization :

Display number of Records via SSI

Quote Reply
Display number of Records via SSI
Hiya all,

loong time since I've been here. First of all..JPDeni yer a Genius <gg>

Now my question. Having successfully installed DBMan with several Mods I was looking for a way to display the number of Records outside the script on another page, since I am using frames.
Now I found a handy one but I cannot get it to display the number of records.
The script I am using is

#!/usr/bin/perl
### count number of records in database.

print "Content-type: text/html\n\n";


=============
open (DB, "/path-to/default.db") or print "Cant' find db!"; while (<DB> ) { $count++; }
close DB;
print $count;
1;

================

and I call it on the .shtml page with

!--#include virtual../cgi-bin/highcapdb/reccount.cgi" -->

Now it doesn't display the number of Records and yes there are three demo records in the DB :)

Can anybody help me with this one ?

Cheers

Broder


Quote Reply
Re: Display number of Records via SSI In reply to
This is a copy of what I'm successfully using for one of my databases:


#!/usr/local/bin/perl

#### using to print number of record in database

print "Content-type: text/html\n\n";

## open (DB, "/path/to/default.db") or print "Cant' find db!";

open (DB, "auto.db") or print "Cant' find db!";
while (<DB> ) { $count++; }
close DB;
print $count;

1;

# ------------------------------------------
#### call script using:

Hope this one works for you.

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