How to keep track of views of a particular mysql entry

I have a dynamic website through php and mysql. How do I get my website to keep track of the amount of views each entry got (and for the amount of views to be recorded in my mysql table? Is there an easy way to do this with dreamweaver?

i do have a column for views but i have do not know how the results would be inputed.
how do i use that "update statement" you mentioned to input increment view amounts in my column?
table_name has column for views.
page is a column in table that is used to dynamically display content based on title in URL parameter ie
website.com/?page=home
website.com/?page=about_us
etc.
Use query to update views+1 where page = the URL parameter that is entered into address bar to display the dynamic page content.
$page = "-1";
if (isset($_GET['page'])) {
$page = $_GET['page'];
$query_hits = sprintf("UPDATE table_name
SET views = views+1
WHERE page = %s", GetSQLValueString($page, "text"));
$hits = mysql_query($query_hits, $connection) or die(mysql_error());
best,
Shocker

Similar Messages

  • How to keep track of how many times a link has been clicked?

    How to keep track of how many times a link has been clicked or accessed? Do I need to use database for this?

    Hi
    Proably something like this can work,
    1> Have a servlet/bean invoked when the link is linked
    2> have a static variable in that servlet/bean wich gets incremented before the control is passed to another desired page..
    The problem with this approach is that care has to be taken that the servlet/bean is not re-instalised, in case of which the static variable will also be instalised and the data would be lost.
    The best thing is to store the count in the database.
    Regards
    Arathi.

  • How to keep track of the users who are all currently logged in

    Hi All,
    I have basic knowledge of Session and Servlets. I am wondering how to keep track of the users who are all currently logged in. There should be some way of achieving it.
    I thought of it and come up with having an Application variable that hold it when ever a user successfully logged in.
    Thanks in advance for any reply.

    You can do this by keeping data in a static veriable in a some class of yours. The variable will need to be a collection.
    Whenever a user loogs in to the site a servlet/jsp should put the users information in to the collection and when logs off or when the session expires the entry should be take off.
    You can achive this by storing the velues in a some sort of a week collection where the entries are automaticaly removed when all the other refferences to the entry goes out of scope.
    You might need to read bit about java.lang.ref package and WeekReference
    Or you can make the entry in the collection contain the last time that the user visited any of the pages and a thread can run time to time and clean up the older entries which have timed out

  • How to keep track of the changes done in ALV GRID Report

    Hi Experts,
    how to keep track of the changed record in ALV GRID Report. how to set the field to be editable even for the entire row also. Can anybody guide along with code also?...
    Valuable answers will be rewarded.
    Thanks,
    Satish.

    Hi,
    Access the table through SM30. It comes blank as standard. Click "New Entries" and make entries for changes to be tracked. For example, whenever an org. unit changes 002 and 003 relationship, you will make entries like:
    01 O 1001 B002 Activate box checked
    01 O 1001 B003 Activate box checked
    Here, 01 is your active plan version, O is org. unit, 1001 is infotype and B002 and B003 are the subtypes. You can also use * for infotype and subtype which means every change will be logged.
    If you then run the report RHCDOC_DISPLAY through SA38, it will pick up all the changes pertaining to B002 and B003 relationship for org. units (in the above example).
    Similarly, you can set up this table for other object types.
    For more information, follow SPRO>Personnel Management>OM>Basic Settings>Activate change documents and go through the documentation for that node. Also, read up the documentation for the report.
    Hope this helps.
    Donnie

  • How to keep Track of the wagetype Changes

    Hi Experts,
    How to keep Track of the Changes after changing the wagetype values.If any body has made changes to the existing wagetype, how do we keep a track of what changes has done, is there any standard Tcode through  which we can get the information.
    Thanks in advance,
    Regards,
    Magesh.S

    Hi,
    Access the table through SM30. It comes blank as standard. Click "New Entries" and make entries for changes to be tracked. For example, whenever an org. unit changes 002 and 003 relationship, you will make entries like:
    01 O 1001 B002 Activate box checked
    01 O 1001 B003 Activate box checked
    Here, 01 is your active plan version, O is org. unit, 1001 is infotype and B002 and B003 are the subtypes. You can also use * for infotype and subtype which means every change will be logged.
    If you then run the report RHCDOC_DISPLAY through SA38, it will pick up all the changes pertaining to B002 and B003 relationship for org. units (in the above example).
    Similarly, you can set up this table for other object types.
    For more information, follow SPRO>Personnel Management>OM>Basic Settings>Activate change documents and go through the documentation for that node. Also, read up the documentation for the report.
    Hope this helps.
    Donnie

  • How to keep track of changes made for a particular Inq Doc number.

    hi all,
    my senario is as follows :
    the requirement is to send mail every time we take print for a sapscript for inquiry ..however the header and the body of the mail will change depending whether the user created a new inquiry doc or changes an existing doc. how to keep track of the changes.
    please give me some suggestion.
    thanks in advance
    Srinivas

    its time cosuming process :
    check table CDHRD/CDPOS tables to keep track of changes.
    Regards
    Prabhu

  • How to keep track of the sequence of the BSP Pages being invoked.

    Hi,
    How to keep track of the sequence of the BSP Pages being invoked.
    I have a BSP Page A.htm. There are two other pages B.HTM and C.HTM in the same BSP Application.
    The page B.HTM has a link A.HTM. The page C.HTM also has a link A.HTM. On clicking  these links the Page A.HTM would be invoked. Is there any way to keep track which BSP Page  (i.e B.HTM or C.HTM) invoked the page A.HTM.
    Any input on this Regard would be of great help.
    Thanks and Regards,
    Pavithra

    Hi Pavithra,
    Declare in page attributes:
    appl_url type string
    In the onClick event of the link that calls the A.htm page , use:
    call method runtime->get_url
    receiving
    URL = appl_url.
    Now appl_url contains the url (also name) of the page that invoked A.htm .
    Hope it helps.
    Anubhav.

  • How to keep track of emails btn Blackberry & Outlook???

    Hi,
    I'm considering buying a Blackberry Curve (Sprint).  My hangup thus far is that I want to have all of my sent emails in my Outlook on my home computer.  My solution thus far has been to use GoToMyPC so that I can connect to my home PC from any computer and take care of my emails.  Also, I work mostly from home, so this isn't a huge problem in terms of convenience and efficiency. 
    Most people tell me that they CC themselves when they send an important email from their Blackberry.  This is how they keep track of important emails sent from their Blackberry.  IS THERE ANOTHER WAY?  A MORE RELIABLE WAY?  IS THERE A WAY TO HAVE ALL EMAILS SYNC'D WITH OUTLOOK WHEN (THEORETICALLY) SYNCING MY BLACKBERRY WITH MY HOME COMPUTER?  IF NOT, WHAT IS THE BEST WAY?
    Thanks in advance,
    Gary 
    Solved!
    Go to Solution.

    I have two (2) EMails addresses; on is my blackberry address, and the other is my Outlook.  I mostly give out my Outlook address so I could have it on my PC at home, and when Isync it is there,. Or, in the field if I inadvertantly delete a message, I know it will still  be on my PC at Home. I think your friend is correct. If she has the Blackberry
    Enterprise System through her IT Dept. at work. I have the BIS (Blackberry Internet Service).
    I hope this helps. It is quite confusing
    Writer~
    Thanks,
    Writer~

  • How to keep track of what I've previously draw

    They said:
    Everytime the paint method is called, everything that was drawn before must be redrawn. The paint method has no way to keep track of what you've previously drawn, it is your responsibility as the programmer to keep track of such things.
    Is this right?
    How can keep track of my random shades of random amounts?
    Is there a simple way to do that?
    In a example, I must use getGraphics to get JPanel's graphics, then I use it to random draw something in the JPanel.
    I just want to keep them in my JPanel when it resizes.I haven't get the answer yet.
    Can you help me?

    Ok I haven't got time to write the code for you, but here's the idea:
    //User drags mouse around to draw on screen
    //use mouseActionListener to catch MouseDragged event
    int x = mouseEvent.getX();
    int y = mouseEvent.getY();
    Point p = new Point(x,y);
    arrayListOfPoints.add(p);
    // end mouse action capture
    //override paint method of component
    public void paint(Graphics g){
        super(g);
        Iterator it = arrayListOfPoints.iterator();
        while(it.hasNext()){
            Point p = (Point)it.next();
            g.drawLine(p.getX(),p.getY(),p.getX(),p.getY())   

  • How to keep track of last song played?

    Hi!
    Does anyone know how to keep track of which song played last time before itunes was closed? I have a big list of songs in my playlist and I play it everyday while I'm working. If I shut down my computer and start it again the next day, I have to manually look for the song I played the previous evening. Is there a way where it will keep track of the last song and play it from that?
    Thanks
    JB

    Subwaygirl, welcome to the Mac family! I'm not sure whether you're asking about beginning to play from the last song played on your iPod or iTunes so I'll answer both.
    From the iPod, simply hit Play and it will begin at the next song. It cannot go back to the last song played.
    From iTunes, use my answer to Chris to add the Last Played column, sort by that and select the song at the top of the list. That is your most recently played song. If you hit the >> or Next button you will then go to the next song in the randomly-sorted list.
    Powerbook G3 Mac OS X (10.3.9)

  • How to keep track of how many records to display in a page.

    Hi All:
    I am using Weblogic 9.2, Web Services Client, and Struts.
    I have a java client in struts that calls a web services.
    The "ID" field contains a Java integer.
    The "First_Name" is a Java String.
    The "Effective_Date" field is a Java date field.
    The web service returns an arrayList of a class called Result.
    Code for Result.java:
    >
    public class Result
    int id;
    String first_Name;
    Date effective_Date;
    public int getId
    return id;
    public void setId(int id)
    this.id=id;
    public String getFirst_Name()
    return first_Name;
    public void setFirst_Name(String first_Name)
    this.first_Name = first_Name;
    public Date getEffective_Date()
         return effective_Date;
    public void setEffective_Date(Date effective_Date)
         this.effective_Date=effective_Date;
    From the arrayList, I displayed the result as the following:
    ID FIRST_NAME EFFECTIVE_DATE
    3 John 9/10/2007
    2 Andrew 1/11/2006
    5 Peter 3/4/2006
    The "ID" header is a link.
    The "First Name" header is a link.
    The "EFFECTIVE_Date" is a link.
    If I clicked on the link "ID", the first time, it will sort the rows in ascending
    order like the following:
    ID FIRST_NAME EFFECTIVE_DATE
    2 Andrew 1/11/2006
    3 John 9/10/2007
    5 Peter 3/4/2006
    If I clicked on the link "ID", the second time, it will sort the rows in descending
    order like the following:
    ID FIRST_NAME EFFECTIVE_DATE
    5 Peter 3/4/2006
    3 John 9/10/2007
    2 Andrew 1/11/2006
    If I clicked on the "First_Name" field the first time, it will sort the rows in
    desceding order.
    If I clicked on the "First_Name" field the second time, it will sort the rows in
    ascending order.
    This applies the same for the "EFFECTIVE_DATE".
    If the arrayList returns 80 records of class Results.java.
    I needed to displayed only the first 50 records for the first page and 30 records for the second page.
    How do I keep track of that so that when I am in the second page, I know to display only record 51 to 80?
    If I have a arrayList that returns 120 records of class Results.java.
    In the first page, it displayed only 50 records.
    In the second page, it displayed only 50 records.
    In the third page, it displayed only 20 records.
    Assuming I am able to sort the rows by ID, FirstName and Effective_Date by using Results.java implementing the
    Java Comparator class. Is it still possible to keep track of how many records displayed in the first page and how many records should
    be dispalyed in the second page?
    Any hint would be greatly appreciate.
    Yours,
    Frustrated.

    Hi,
    Access the table through SM30. It comes blank as standard. Click "New Entries" and make entries for changes to be tracked. For example, whenever an org. unit changes 002 and 003 relationship, you will make entries like:
    01 O 1001 B002 Activate box checked
    01 O 1001 B003 Activate box checked
    Here, 01 is your active plan version, O is org. unit, 1001 is infotype and B002 and B003 are the subtypes. You can also use * for infotype and subtype which means every change will be logged.
    If you then run the report RHCDOC_DISPLAY through SA38, it will pick up all the changes pertaining to B002 and B003 relationship for org. units (in the above example).
    Similarly, you can set up this table for other object types.
    For more information, follow SPRO>Personnel Management>OM>Basic Settings>Activate change documents and go through the documentation for that node. Also, read up the documentation for the report.
    Hope this helps.
    Donnie

  • How to keep tracks together in shuffle mode?

    When playing in shuffle mode you can't hear tracks in line together while they should be, e.g. in conceptalbums.
    Is there a way to overcome this?
    (You can do it with complete albums when downloading in the Library, but what can you do when the tracks are already in the Library?)

    Joepiet wrote:
    The second tab is calles 'Info' as well. Down under you have the possibilty to mark Part of a collection (Deel van verzameling). It should do the trick but it doesn't. I once tried, but I haven't found out what it does.
    In English, that is named as "Part of a compilation" and Google Translates that as "Deel van een compilatie". As far as iTunes is concerned, this means that the album has songs by different artists, albums such as the "Now X" series. It is how iTunes keeps a Various Artists album together.
    Joepiet wrote:
    I want to shuffle works, not tracks..
    Ah! I see what you want now!
    Two possibilities that I can think of (number 2 is the better one):
    Create a Playlist for each "work", by simply adding all the songs from one work to one Playlist and all songs from the next work to another Playlist and so on. Then, if you want to play one complete work, followed by another complete work, you could simply create a further Playlist and add each "work Playlist" you want to this new Playlist. To make the works random, all you could do is choose for yourself as you are adding them. You would need to play this new Playlist in order, not shuffle.
    If you originally imported this music from a CD, you could import from the CD again. But this time, combine the tracks that make up one work, as one track. iTunes names this as "Join CD Tracks" (or CD-tracks samenvoegen in the Dutch iTunes).
    In the screenshot above, I have selected tracks one, two and three and then used the options menu to find Join CD Tracks. This third option will not be visible until you select two or more adjacent tracks, as shown above.
    In the screenshot below, I have joined tracks one, two and three as one "work". Then joined tracks four, five and six as a separate work. Finally, I've joined tracks seven through twelve as a third work.
    Notice in the screenshot that the Options menu says "Unjoin CD Tracks". That is because the highlighted ones (7-12) are currently joined.
    And here it is in Dutch:
    With this second method, a work (of several tracks) will always be played as one track (or song). You can then simply add all the individual works to one Playlist, and play the Playlist in Shuffle Songs mode. That way, each work would be played in full, followed, at random, by another work.)
    And if you really need to - import the CD this second time with a slightly different album name, so that you then have two copies. One, where each song (or track) is the individual song on the album and the second where each "song" is a work.
    Now, lets hope I can get my iTunes back into "English" English, as my Dutch is not too good, even though I'm just the other side of the North Sea from you!

  • How to keep track of sessions ?

    Hi,
    Recently at an interview I was asked that how do you keep track of n number of user sessions in JSP ?
    Can somebody help me with the answer that I should have given ?
    Thanks.

    You would have to extend the session handling system using the various listeners for Session events. Check out the package javax.servlet.http.
    SessionListener: responds to sessionCreated/sessionDestroyed - so you can keep track of sessions as they come/go.
    You then also keep in memory (either a singleton, or in application scope) a permanent map of all the sessions. That way you knoe exactly how many sessions there are, and can get at the data for any or all of them.
    (Note this is a potential security risk, which is why the functionality was removed from the servlet framework)
    Another approach would be to use a SessionBindingListener, on a user object. This listener fires events when the object is bound/removed from a session
    Assuming it is an Intranet, where a user logs in, and after login, a "User" object is placed into session. This will let the user object fire an event whenever it is bound - ie when you log in. Thus you can keep track of who is logged in, and if they are logged in multiple times.
    Hope this helps some,
    evnafets

  • How to keep track of which checkboxes are checked

    I have 21 checkboxes on a scene and want a user to have to
    pick at least four of them, i will then use the ticked checkboxes
    to bring data back from a database. My question is how do i keep
    track of which checkboxes are clicked so i can put them in to a sql
    statement like this?
    select * from table where title in (checkbox1, checkbox2,
    checbox13);
    And how do i make sure the user has picked four boxes before
    being allowed to leave the current frame?
    EDIT: sorry this is probably in the wrong forum it should go
    under basics, but instead of posting the thread there can someone
    please reply to it here, thank you.

    i am using flash component checkboxes, i tried to come up
    with my own way to do this i am doing different:
    on CheckBoxState -- name of custom handler
    TickedBoxes = [] -- a empty list will be filled where ever a
    checkbox is ticked
    CheckBoxNames = ["dr no", "from russia","goldfinger",
    "thunderball", "you only live" ]
    -- the above is a list containing the names of all my
    checkboxes
    repeat with i = 1 to 5 - repeat for each checkbox
    CurrentCheckbox = CheckBoxNames
    -- used to keep track of which box is checked this sets
    currentcheckbox to value of i, i is a checkbox from checkboxname
    list
    if the hilite of member(CurrentCheckbox) then -- if
    currentcheckbox hilite is true (checked)...
    append(TickedBoxes, CurrentCheckbox) -- ... add
    currentcheckbox to the tickedboxes list
    end if
    end repeat -- end repeat
    return TickedBoxes -- return the list of checked boxes
    end
    on mouseUp me -- on mouse click
    choosenBoxes = me.CheckBoxState() -- chosenboxes is a
    variable calls the handler on it
    -- will put sql here
    end
    this is the only script i have which is attahced to my
    submit button, but for some reason when i try to trace the results
    in the message window it always return void can anybody tell me
    what i am doing wrong?

  • How to keep track of client in rmi server

    how can I keep track of a disconnected client in a rmi server ?
    And what logic do I use to disconnect a client fro mthe server ?

    When a RMI client receives a stub to the remote object, RMI client runtime sends a dirty() call to the RMI server runtime which in turn helps the RMI server runtime in updating the client references to the remote object. Client reference is nothing but a unique identification generated by client RMI runtime for that instance of JVM. RMI uses a reference counting algorithm for destroying unreferenced remote objects. Once all references (all clients who are holding the stub to this remote object) to a remote object drops to zero, local garbage collector takes care of freeing this remote object.
    RMI client runtime initiates a TCP connection with the remote object only when a method is invoked on the stub. RMI transport layer uses a simple connection pooling mechanism to use already established TCP connections with server objects in further remote method invocations. Let's say the client is invoking a remote method on the remote object's stub fetched from the registry service. Now RMI transport layer initiates a TCP connection with the remote object (exported at ("host1", 4567)). After completion of the remote method, RMI client's transport layer keeps the connection open for some time (some configurable value) to take the advantage of the already established TCP connection in future remote method invocations on remote objects exported on the same host and port ("Host1", 4567"). RMI transport layer also takes care of closing these connections if the connections are idle more than configured value of connection open time.
    From the RMI server's perspective, once the RMI server runtime receives a remote method invocation request from the RMI client, it creates a new thread and try to dispatch the method on the designated remote object. After returning the results of the remote method to the client, RMI client's transport layer may not end this conservation with this remote object to take the advantage of this TCP connection in future remote method invocations. So the same thread may be used for dispatching another remote method in future. This is actually the side effect of re-using the established TCP connections on the client side.
    RMI server maintains client's reference in the client's reference set of the remote object as long as the client holds a normal reference to remote object's stub in its JVM. Once the client relinquishes the reference to the stub (goes out of the scope or setting it to the null), RMI client automatically sends clean() call to the RMI server runtime to update client reference set of the remote object. There is no public API to lookup or manipulate the client references for a given remote object, but you can always unexport the remote object even some clients are holding stubs to the remote object. Next time when the client invokes the remote method using this stub, client will receive a "connection refused exception" from the server because the remote object is already unexported. Let's say if the RMI server is started again (remote object is exported and registered with registry service), the client once again obtains the stub to the remote object from the registry service instead of using earlier stale stub. (This time remote object may have been exported on different port, so the port details in the old stub may not be valid any more).
    At any point of time there can be more than one established TCP connection with the RMI client. This may be the temporary condition; RMI client's transport layer automatically closes these connections if it does not receive any remote method invocation requests with in a pre-determined interval of time (default: 2 min). You can always find out RMI client's host in a given remote invocation by using getClientHost(), but how can you semantically define a "disconnected client in a rmi server" in your application context ? You can always force all the clients to fetch the stub again in future remote method invocations by unexporting the remote object in RMI server. I hope this information helps ...
    -- Srinath Mandalapu

Maybe you are looking for

  • HT5902 Photo stream sharing w/iPhone 4S & iPad mini

    My new iPad mini is not showing the photos from my iPhone4S . I have the cloud settings on for photo stream sharing on both the iPhone  4 and the iPad mini. What am I doing wrong? I did reboot both devices. Thank you!

  • Cisco Presence/Jabber both internally and externally

    We have installed the Cisco Presence server and intergrated it with our Microsoft Exchnage for ldap, Cisco Unified Communications Manager, and Cisco Unity Connection for phone and voicemail support.  It is all installed inside our corporate network a

  • PDF attachment to Customer Master Data

    Hello! I have a requirement to create a attachment to the customer master data (TCODE FD02 for example) in background. In online mode, there is a icon on the top left that allows you to attach files. I want to a attach a pdf file. Is this possible in

  • Iphone Update

    Hi All, I am trying to update my iPhone 4s from iOS 5 to iOS 5.0.1 but i got an error message : "The iphone .......cannot be updated at this timebecause the iPhone software update server could not be contacted or is temporary unavailable. Please try

  • Is there a way to have a item NOT require a password on a non-admin account

    I use my Mac with Adobe Creative Suite (3) to make files (jpeg) that are formatted for cell phones to make animated and static wallpapers for phones to make a profit and i got a new printer because my old printer broke. on my old printer it would sho