473,395 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Tracking what has been requested

Hi I have created a php mysql web site where I am streaming videos, the user selects a video from a list then it displays on my detail page. I have around 150 videos to keep track of . I need to run a report on what videos got selcted the most in that week(top 20).
I go and look and my server log and I can only see that my detail.php page is been displayed x times not what video got selected ( some of the videos are links frm the record companys) . How do i make my detail page log in my database what got played?

I hope this make sence
Thanks for ANY HELP
Cheers
Dave
Jan 17 '07 #1
2 1108
ronverdonk
4,258 Expert 4TB
I assume that the visitor count is updated (possibly by your provider) at the moment the page is visited.

To get the data you want, you'll have to make some arrangement in the script that accepts the user's choice and/or shows the stream.

E.g. when a user selects a video you can. at that moment in your script, insert a row into a MySQL table, with all data you want to to record, like userid, IP address, title of video, etc.

Ronald :cool:
Jan 17 '07 #2
BeRtjh
12
Make a extra column with the name 'views'
whenever a video is clicked, just do a mysql_query:

[PHP]
$query = "SELECT view FROM table_name WHERE id='".$_GET["id"]."'";
$result = mysql_query($query);
while(list($view) = mysql_fetch_row($result)){
//you now have the current count of views, now add one
$count = $view + 1;
//now insert the count into the db
$query = "UPDATE table_name SET view='".$count."' WHERE id='".$_GET["id"]."'";
}
[/PHP]

Heres the Top 20 page script:

[PHP]
SELECT * FROM table_name ORDER BY view DESC LIMIT 20
[/PHP]
hope this helped.
Grtz Bertjh
Jan 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Paul Lee | last post by:
Hi, I posted a question to this forum a few days ago and got a veyr good response - unfortunately I asked the wrong question (I asked about referring domains, not IPs of visitors). I've got a...
3
by: Kyle Friesen via AccessMonster.com | last post by:
Mike, I have databse that creates a "tracking number" based on the selections made on the form via concatenating. At the end of the tracking number, I need a two digit (01-99) sequence number by...
6
by: A.M-SG | last post by:
Hi, We are developing a SmartClient application and we are planning to expose business objects layer to SmartClient application by using ASP.NET SOAP web services.
0
by: Mr.Kane | last post by:
I am working on compiling a Metrics report (using Pivot tables in Excel) measuring statistics on an Access 2000 DB which is a front-end to a series of Oracle 9i tables. Anyway, I am trying to...
2
by: runner7 | last post by:
Can anyone tell me if there is a way in PHP to determine when a session times out on the server or how many concurrent sessions there are in your application?
1
by: Jimmy | last post by:
In the asp.net application I develop, we need to provide the marketing department with the ability to insert small JavaScript code snippets into predefined content areas on several pages. This code...
1
by: bdockery | last post by:
So I figured out that if you use this html: http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=<TRACKING...
7
by: Ben Amada | last post by:
Hi ... I have an HTML page containing a bunch of <alinks. Some of the links redirect the visitor to a page at a different website in a new browser window (target=_blank) and other links are...
3
by: =?Utf-8?B?R3JhaGFt?= | last post by:
I've added 2 tracking services to the wf runtime; one is the standard SqlTrackingService: trackingService = new SqlTrackingService(<trackingConnectionString>); <workflow...
0
by: LiveTecs | last post by:
http://www.livetecs.com TimeLive Web Collaboration Suite is an integrated suite that allows you to manage project life cycle including tasks, issues, bugs, timesheet, expense, attendance. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.