Nik has asked for the wisdom of the Perl Monks concerning the following question:
What must be add to this code that is able to save each unique webpage counter at a specific mysql table field adding 1 every time and also do this for every new page i create because the number of the pages aren't fixed plz post it here.my $db = ( $ENV{'SERVER_NAME'} !~ /varsa/ ) ? DBI->connect('DBI:mysql:pneumatika;localhost', 'root', '***** +**', {RaiseError=>1}) : DBI->connect('DBI:mysql:18177_pneumatika;fdb1.runhosting.com' +, '18177_pneumatika', '*****', {RaiseError=>1}); $select = $db->prepare( "SELECT counter, host FROM guestlog" ); $select->execute; my $pagecounter; while( $row = $select->fetchrow_hashref ) { $pagecounter += $row->{counter} unless ($row->{host} eq "varsa); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Making an automatic counter adder for all webpages
by Fletch (Bishop) on Dec 22, 2007 at 15:04 UTC | |
by Nik (Initiate) on Dec 22, 2007 at 16:00 UTC | |
by polettix (Vicar) on Dec 22, 2007 at 16:15 UTC | |
by Nik (Initiate) on Dec 22, 2007 at 21:17 UTC | |
by polettix (Vicar) on Dec 23, 2007 at 01:40 UTC | |
|