how can I connect the script to a MYSQL database

Post your Click counter digestion problems here
Post Reply
seeme101
Posts: 1
Joined: Mon Feb 25, 2008 1:25 am

how can I connect the script to a MYSQL database

Post by seeme101 »

my little sandbox

Great script, works great
I know the whole point was to make it easy with text files.
but what if I have 500 pages I want to count?
Yes, I know, I need 500 text files

how can I connect the script to a MYSQL database so I can forgo
making 500 txt files?

thanks
It's not stupid, it's advanced. I'm gonna roll around on the floor for a little bit, K. Hi floor, make me a sammish. Can I be a mongoose dog?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

This would require quite some editing and is out of the scope of my support here. Try finding a script that already uses MySQL databases.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
puniksem
Posts: 47
Joined: Thu Nov 01, 2007 12:25 pm

Re: how can I connect the script to a MYSQL database

Post by puniksem »

seeme101 wrote:my little sandbox

Great script, works great
I know the whole point was to make it easy with text files.
but what if I have 500 pages I want to count?
Yes, I know, I need 500 text files

how can I connect the script to a MYSQL database so I can forgo
making 500 txt files?

thanks
I think you're mistaking graphic counter for click counter which only uses one clicks.txt file to store all links, whereas graphic counter requires a txt file for every different counter added.
World's shortest poem: We, see.
puniksem
Posts: 47
Joined: Thu Nov 01, 2007 12:25 pm

Post by puniksem »

Klemen wrote:This would require quite some editing and is out of the scope of my support here. Try finding a script that already uses MySQL databases.
You don't need 500 files, all the counting is stored in one txt file, however with 500 links being monitored, you might want to consider breaking up the hit counts by running two versions of the script as long as their folders are different with uniquely named clicks.txt files.
World's shortest poem: We, see.
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

When a script stores its main data to one text file over time the one file gets to big to constantly rewrite correctly so it will crash somtime, and the data will get currupted. I have a buddy who perfected his flatfile db sysyem and its been tested for over 30,000 entries and runs very fast as it stors all data in sep data files, this works very well as each data file is only a few k big so the odds of it having a problem are very slim, plus if it did its one file not thousands of lines that can be damaged in a standard flatfile write.

So that is why we recomend using MYSQL if you are going to store masive amounts of data as that is the most reliable way to do it, as most flatfile scripts do write to one main txt file.

But on the other hand many times MYSQL is a pain and not needed if say your only working with a small amount of data then a text based flatfile system as Klem's site leads the way with is the way to go.

I have modified many of Klems scripts and they all work very well as long as they are used as he intended.

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
Post Reply