stat system

A

Anonymous

Guest
ok I am lost in my own projekt here, and collecting all the info is so easy but how do I pull it out again and show it as I want it to be shown.

example here I have 3 refering urls (there will be many more) I want to find out how many different urls there is (in this case there is 3) and when I know how many different there is, then I at the same time want to know how many time EACH of the different urls is listed in the db

so first it finds the urls and dump the url string into vars $url1, $url2, $url3 etc etc depending on how many there is

next I want to find out how many times the different urls is listed and write it to vars like this $url_count1, $url_count2, $url_count3 etc etc.

how do I do all this? I am just pretty lost right now since it is so many things the script has to do at the same time, please help

Godiwa
 
I’m not sure how much info you want/need to retrieving info from a database. http://www.php.net/ is a great source to figure out how to do this. If you want more details, just write back and we’ll help out. What you might want to do is read in the urls from the database into an array. Once you have this array of urls, you can use the following php functions on the array:

Array_count_values( $array ) this function will count the values in the array, thus giving you a count of each url in the array.

Array_unique( $array ) this function will return an array with the duplicate urls removed. You can then use this new array to display them back to the user, or do whatever it is that you are doing with the urls.

Further descriptions of the functions can be found on http://www.php.net/ This should point you in the right direction. There may be a way to do the same thing w/ SQL, but the above is how I would go about it, depending what you want to do with the dataset once it has been returned.

Good luck
 
Use the MySQL database.....
all what you need just 3 field:
1 - date including,
2 - date last visit,
3 - date last change...
all you may manage form PHP
 
Back
Top