Mysql database, counting records

Hi!
I have to store measured data to MySQL database. During this process I would like to count a number of records in a database table. It is also necessary to filter records. I'm using the SQL statement as follows:
SELECT COUNT (fieldname) AS cnt FROM table WHERE condition
Because I haven't got any result I've created a small database "mysweetdb" and table "icecream" to test my VIs (see picture bellow).
The VI is attached. The result of counting is a 2D array (DB Tools Fetch Recordset Data.VI output) with one element (one row and one column). This element contains no data.
I usually don't give up easily so I've created a similar MS ACCESS database and counted data in it. I've got a correct answer: 3. So it might be possible that there is something wrong with MySQL driver. But I've created a small Delphi project and I've counted records in MySQL database and MS ACCESS database. Both results were correct.
Can anyone explain where is the problem in communication between LabView and MySQL database?
Versions: XAMPP for Windows 1.7.3, LabView Developer Suite 2010 SP1, MySQL 5.1 ODBC driver
Thanks in advance for your suggestions.
Attachments:
Count records.vi ‏19 KB

ContDivConsult,
thank you for your answer. An updated version of my VI is attached. It uses two options: LabSQL library and DB Connectivity Toolkit. LabSQL gives correct results.
Regards,
Ljubo.
Attachments:
Count records.vi ‏25 KB

Similar Messages

  • Php/MySQL database insert record issue...

    I have a php page that adds an "order" to a mysql database table (orders). One text field in the form is for tires/wheels. The description of the wheels often includes the " symbol for inches after a number....Everything submits fine, however when I look at the page that displays the orders all the data after the " symbol including the " symbol is gone... DOes anyone have any idea why this may be happening? It is requiring us to return and edit that area repeatedly. Any help is appreciated greatly. Thanks for your time.

    Ok, so just to summarize so I am understanding this correctly.  You have an ordering page for tires/wheels.  A customer places an order for tires/wheels and the data is submitted successfully and this includes a symbol for measurement (in.).  But on another summary page the symbol is returning a blank value.
    If this is correct we need to see:
    - First, the code that is inserting the symbol to the database table in question
    - Second, the query and code where you are printing the data to the screen.

  • MySQL database record hits counter?

    Can I find out how many times a record from the MySQL databse was called and displayed on a web browser?Basically a MySQL database record hits counter. I’m using PHP/MySQL.
     

    >to the two files that were created
    >Two files?
    Yes 2 files. In Dreamweaver CS3 & CS4 When using the "Insertà Data Objectsà Master Detail Page Set" function you must create two files:
    1. results.php
    2. detail.php
    It appears that these two files work together hand in hand. You did not specify where nor how to include an update record set that gets executed every time another record set that I want to count fires. So I combined the two as one until it was clarified. 
      

  • Update command overwrites 1st record in mysql database

    hi
    I'm having a bit of a problem with a form I created in livecycle designer.
    I have connected the form to a MySQL database.
    whenever I try to update a record , retrieved via navigation buttons or search box, the 1st record in the mysql database is overwritten.
    I'm using the xfa.sourceSet.DataConnection.update() with and an click event
    I have my Stay BOF and Stay EOF set on the data connections.
    I'm not sure what I am doing wrong.
    The forms Data connections are using sql select query because the table in the database has an auto incrementing column.
    any suggestions you guys provide will be appreciated.

    Guys, I am still racking my brain. I have taken some screenshots to show you how I have my database tables set up. I was able to get the tables over to the InnoDB type so I can make foreign keys. Here is how I currently have them setup, can someone check this out and see if it's correct?
    Table 1 (carinfo)
    Table 2 (images)
    Thanks

  • Recording events in mySQL database?

    I am new to Java and would like to know if the following can be done:
    We have a web page where the user chooses to watch different Windows Media Files using a Java menu system (not written by me).
    Is it possible to record what the user is doing (i.e. which media files they are choosing) in a mySQL database? I would normally do this with PHP, but as all the action is happening once the page has loaded I don't think that will work.
    Thanks in advance!

    Sure it's possible if you notice the events and can pass on the actions to a component that does the writing.
    You can do it in PHP - unless it uses some magic to switch the embedded movies somehow, a new page has to be requested for a movie. If it all runs within the applet (I hope that this is what you mean, and not Javascript) and you can't modify it, then you can't, unless you can convince your webserver to log to the DB.

  • Record string indicator to mysql database

    Hi experts, i have 3 string indicator and i want to record the data to mysql database. i already have a table with 3 column. how can i do that?
    Thank you
    Attachments:
    test.vi ‏18 KB

    attached is my vi. since i'm really new to programming and labview, can please somebody advise me about my vi. I will use this vi to record minutes of meeting to a mysql database. the dalog_resp.vi is used to fill the responsible string.
    I need to display all mysql data into a table and i need to short the data based on project, meeting date, status and responsbile (i'm thinking to use combo box). e.q if i  choose "SAM" from responsible combo box, i want the table only show the data contain SAM value. And i have another problem...when i put the boolean button into a cluster, it won't call the dialog_resp.vi
    Please advice me...
    Thank you
    Regards
    Ijan
    Attachments:
    db.vi ‏534 KB
    Dialog resp.vi ‏11 KB

  • How to get data into the mySQL database?

    First some background.
    I have a website that has outgrown its designed dimensions and is a huge burden to maintain. See PPBM5 Benchmark
    There is a lot of maintenance work involved, so I'm investigating a PHP/MySQL approach to easen the burden and to add functionality to the site. With the current Excel based structure and over 420 entries, it is cumbersome for me to maintain, but also for users to find what they need.
    A MySQL based dynamic structure is a lot easier and offers vastly more selection capabilities, like selecting only records that meet specific criteria.
    Data submission is done with a form, that contains most of the relevant data, but the drawack is that people submitting their data are often not technically inclined, give wrong answers due to a lack of understanding or making typo's. The test results are attached in one or two separate .txt files, but often they have not read the instructions correctly or did something wrong, so these attached .txt files can not be trusted automatically, they have to be checked before inclusion.
    These were my initial thoughts:
    1. Data collection:
    To avoid spending all our energy and time  on correcting typo's, getting missing data, correcting errors, I am  investigating the use of CPU-Z in Ghost mode to create a .txt or .html  file that contains all relevant hardware info we need and even more. It gives all the info we currently have, but adds  data like number of memory sticks, DDR timings, stock clock speed and  BCLK setting, video card info and VRAM size, etc.
    To see what I mean, run CPU-Z, go to the About tab and press the Save Report button and look at the results.
    This can all be done without user intervention in an automatic way, but  maybe I need to add an Auto-It file to the test to make it all run as  desired.
    If this works and I'm able to extract the relevant data from the created  file and can insert it into the database, we may be in business for the  next version of PPBM5.5 or PPBM6. It does require a modification to the instructions, making them a lot  easier, because there is less data to fill out.
    2. Data submission:
    The submission form can be simplified if  the CPU-Z data can be used. We have to create an automatic way to attach  the created .html file from CPU-Z to the submission form and we have to  streamline the Output.txt and Output-MPE.txt files to be more easily included in the 'form.lib.php' file. It  currently is manual labor and very time consuming.
    3. Adding to Database:
    I have to find a way to create database  records from the Gmail forms I receive. All incoming mail messages need  to be checked on relevancy and if relevant, need to be added  automatically to the database and then offered for approval before final inclusion in the database. Data included in the database  will then include submission date and time, Email address,  IP address  used, plus links to the files submitted and available on the website.
    4. Publication of the database:
    After approval of new records from step  3, all updates will be automatically applied to the database and  accessible for users. I do not yet intend to introduce a user account ,  requesting login before all functionality is accessible. Too much trouble and administration.
    Queries should be possible on things like CPU (check box), so include  17-920, i7-930, i7-950 but exclude i7-980X and i7-990X, Size of memory  (check box), Overclocked (boolean, yes, no), SSD as OS disk, and similar  options.
    The biggest problem is to keep the color grading and statistical  indicators (Top, D9, Q3, Med, Q1 and D1) intact on dynamically generated  queries. Say you make a query which results in 20 observations, this  should show the related colors and legends. Next query results in 48 observations and of course the color grading and legends  do need to reflect that. Question in my mind, does the RPI remain  constant, independent of the query or does that need to be recalculated  on the basis of the query?
    Next thing is to allow a user to select a specific observation and by  simply clicking on it be shown, in a separate window (detail page) or  accordion, all the CPU-Z related information about the hardware.
    The graphs, Top-20 and MPE Gains, need to be dynamically adjusted, based on the query used.
    5. Ideally, external links:
    In an ideal situation, one could link the  CPU-Z data to external price databases, looking up current prices for  CPU, memory, video card, disks, raid controller, etc. to get instant  BFTB charts, based on the query made. But that is the next step.
    Situation now:
    I have a MySQL database that is easily updated with the new submissions. Simply create a .CSV flie from the submitted forms and import that into the database. The bulk of the initial work is done.Lots remain to be done as you can see above, but that is for a later time.
    Question:
    I have this table, that needs to be filled with data in the submitted and attached files. Mr. X submitted his data and can be uniquely identified by his "Ref_ID". He attached one or two files in .TXT format with the relevant test data. These files are stored on the server with a concatenated name:
    "Ref_ID","-","filename"
    Say his Ref-ID is: 20110204-6cf5 and his submitted file is called: Output(99).txt then the file can be found on the server as
    20110204-6cf5-Output(99).txt
    I need to be able to open that comma delimited file, the contents may look like this: "439","1036","819","531" and insert these contents into the relevant record and fields.
    Graphically,
    is what I want to achieve.
    This being my first exposure to PHP/MySQL, you can imagine I'm not clear on how to go from here.
    Added complication is that I actually have 5 numbers to insert per record and two calculated fields, Total Score and RPI should be calculated fields. Haven't yet figured out how to handle calculated fields, maybe only in the PHP/HTML code and not in the database.
    I hope someone can help me.

    You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
    http://www.youtube.com/user/phpacademy
    http://www.youtube.com/user/betterphp
    http://www.youtube.com/user/flashbuilding
    And many more on my channel here
    http://www.youtube.com/user/Whisperingonthewind
    CMS's are easier to maintain, add edit and delete content.
    I have also recently bought a Book by David Powers Training from the Source very helpful.
    Anyway hope you get it sorted.

  • How can I include a MySQL table and records with the PUT of my Dreamweaver site?

    I am using .php to validate a user code against one of four codes that I am providing to potential clients.  They enter that code, along with a default user id and the appropriate page is then displayed for them.  Everything is working fine on the desktop.  I need to have this table and the records created on my remote server.  I tried saving the table in the Connections folder, but that didn't help.  Everytime I enter a code (valid or invalid) on the live site, I get the following message:  "Table 'boundsauctions_com.promocode' doesn't exist".  Is there someway to include the table and records in my Dreamweaver folders for the site? 
    Thanks for any help that you can offer.

    You can't.  Dreamweaver, or FTP for that matter has no connection to the MySQL database.  If you have created a MySQL database locally and now wish to move/copy it to your server you'll need to create a back up of your local database and then log into your database on the server and then restore that back up.
    An even easier way to do this, and if you are working with MySQL much at all  a good investement is to get the commercial version of Navicat MySQL - this is the best MySQL administrator I've found to date and is well worth the few bucks to buy it.  With Navicat you can connect to your local MySQL database and also create a connection to your remote database, then literally drag and drop your local database contents to copy them to your server. This function alone justifies buying Navicat. A huge time saver.   And no I do not work for or have any share or ties to Navicat.  I'd recommend something else if I knew of anything better, but so far I don't.
    Hope this helps. If you need any more details let me know.
    Lawrence Cramer - *Adobe Community Professional*
    http://www.Cartweaver.com
    Shopping Cart for Adobe Dreamweaver
    available in PHP, ColdFusion
    Stay updated - http://blog.cartweaver.com

  • ***No Table found, when creating a recordset to MySQL Database

    I have made a successful connection to the MySQL database.
    When attempting to create a record set (Query) under the Application/Bindings Tab, I select the connection, but then the Table field says *** No Table Found
    Also under Application/Databases tab, the connections appear. When expanding the + for the Table it says "None"
    I do have Tables in the MySQL database which Dreamweaver has a connection to, so that is not the problem.
    I've searched multiple forums on the internet for this problem, and while I have found that others have had this problem, I have not seen any solutions.
    Any help would be greatly appreciated.
    I am a novice in this area, so if you need any additional information from me, please be as specific as possible as to where and how I can get it.
    Thank you in advance for your help.
    Additional information:
    Windows 7 Ultimate
    Dreamweaver CS3 (Creative Suite 3 Web Premium)
    Apache 2.2.15-win32-x86-openssl-0.9.8m-r2
    PHP-5.2.6-Win32
    mysql-workbench-gpl-5.2.25-win32
    Freshly reformatted computer and only installed the above software along with AVG antivirus.
    Edit: I should also note that this is for a local testing server. I am not trying to connect remotely.
    Best Regards,
    Blain
    Message was edited by: Blain1976

    Now the problem has gone from bad to worse.
    I previously had a connection to my database but just couldn't see the tables.
    Now after I added another user I can't even make a connection. Instead I get an error message that says "An unidentified error has occured"
    My server and database are actually running. I can loginto my database through the MySQL workbench. It says it's running. The apache server also says it's running and if I key in localhost in my internet explorer it says "It works!"
    I have now deleted the new user in MySQL  that I added and now I can't even connect to the database in Dreamweaver.
    Any suggestions?
    Thank you,
    Blain

  • Inserting xml data in a MYSQL database

    Hi,
    I would like to know how i can insert data from an xml file into a MYSQL database using a java program, I currently have a program which retrieves an xml record and i need to insert the information between the tags into a table in MYSQL..please help me out if anyone knows...i am not very familiar with java...thanks

    Hi there Sherkhan,
    Im trying to do exactly what ur doing, inserting xml data in to a mySQL database. Any chance u could share the code for this???
    Many thanks in advance.

  • Submitting Pdf form fields to a MySQL database via PhP

    Hi there,
    I have recently created a Pdf in Adobe LiveCycle which looks great, and I have added a submit button which is set up to send all the form data in HTML to a PhP file on the server side. The PhP file then collects the form data and inserts it into my MySQL database.
    When I run this form from Adobe reader or Professional it works great and the new record is inserted in the database. However I am trying to embed the form into a HTML page, which again looks fine, and all other buttons i.e. Save As, Print work fine.
    The submit button however is not working properly now. It inserts a new record into my database, but the fields are blank as if the form data has not been sent or received?
    Can you possibly advise me where i'm going wrong.
    Much appreciated
    Cane

    Hi Cane,
    I'm relatively new to creating Adobe Forms but I'm looking to do exactly what you have set up, submitting the results to php which sends the results to a database. I don't like the responses being sent to a pdf response file then every so often you have to export to csv then import the results into a database....too tedious. Can you perhaps provide the code that goes behind the submit button and maybe the code that you use on the php/server side? Again, relatively new to this and don't know where to begin but if I can look at the code behind this it would make things a lot easier.
    Thanks,
    Ed

  • Using MySQL database in Jdeveloper

    I am using MySQl database in my applicaion.I have successfully created connection to the database and have created entity beans from the tables and a session bean as well to use the entity beans
    now when i am trying to call persistEntity(object obj) of session bean, basically to insert records into tables.
    i am getting following exception :
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"tdmce_approval_status" (APPROVALLEVEL, DOCREFNO, STATUS, COMMEError Code: 1064
    Call:INSERT INTO "tdmce_approval_status" (APPROVALLEVEL, DOCREFNO, STATUS, COMMENTS, DMCETYPE, ACTIONDATE) VALUES (?, ?, ?, ?, ?, ?)
         bind => [1, 12355, Approved, abcd, import, 12/03/2008]
    i believe this insert query is automatically generated by Jdeveloper. have tried executing the same query in sql sheet it has worked perfectly fine.
    Can any one please suggest on this ?

    Hi Frank,
    thanks for your response, there are only setters & getters method in my entity
    my entity look like this
    package buslogic;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.IdClass;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "TdmceApprovalStatus.findAll",
    query = "select o from TdmceApprovalStatus o")
    @Table(name = "\"tdmce_approval_status\"")
    @IdClass(TdmceApprovalStatusPK.class)
    public class TdmceApprovalStatus implements Serializable {
    @Column(nullable = false)
    private String actiondate;
    @Id
    @Column(nullable = false)
    private Integer approvallevel;
    private String comments;
    @Column(nullable = false)
    private String dmcetype;
    @Id
    @Column(nullable = false)
    private String docrefno;
    @Id
    @Column(nullable = false)
    private String status;
    public TdmceApprovalStatus() {
    public String getActiondate() {
    return actiondate;
    public void setActiondate(String actiondate) {
    this.actiondate = actiondate;
    public Integer getApprovallevel() {
    return approvallevel;
    public void setApprovallevel(Integer approvallevel) {
    this.approvallevel = approvallevel;
    public String getComments() {
    return comments;
    public void setComments(String comments) {
    this.comments = comments;
    public String getDmcetype() {
    return dmcetype;
    public void setDmcetype(String dmcetype) {
    this.dmcetype = dmcetype;
    public String getDocrefno() {
    return docrefno;
    public void setDocrefno(String docrefno) {
    this.docrefno = docrefno;
    public String getStatus() {
    return status;
    public void setStatus(String status) {
    this.status = status;
    & session bean class to call the same
    package buslogic;
    import buslogic.persistance.TdmceApprovalsFlow;
    import buslogic.persistance.TdmceApprovalsFlowPK;
    import buslogic.persistance.TdmceUserDetails;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name = "FirstCheckFacade")
    public class FirstCheckFacadeBean implements FirstCheckFacade {
    @PersistenceContext(unitName = "SOAServices")
    private EntityManager em;
    public FirstCheckFacadeBean() {
    public Object mergeEntity(Object entity) {
    return em.merge(entity);
    public Object persistEntity(Object entity) {
    em.persist(entity);
    return entity;
    /** <code>select o from TdmceApprovalsFlow o</code> */
    public List<TdmceApprovalsFlow> queryTdmceApprovalsFlowFindAll() {
    return em.createNamedQuery("TdmceApprovalsFlow.findAll").getResultList();
    public void removeTdmceApprovalsFlow(TdmceApprovalsFlow tdmceApprovalsFlow) {
    tdmceApprovalsFlow =
    em.find(TdmceApprovalsFlow.class, new TdmceApprovalsFlowPK(tdmceApprovalsFlow.getApprovallevel(),
    tdmceApprovalsFlow.getDmcetype()));
    em.remove(tdmceApprovalsFlow);
    /** <code>select o from TdmceUserDetails o</code> */
    public List<TdmceUserDetails> queryTdmceUserDetailsFindAll() {
    return em.createNamedQuery("TdmceUserDetails.findAll").getResultList();
    public void removeTdmceUserDetails(TdmceUserDetails tdmceUserDetails) {
    tdmceUserDetails =
    em.find(TdmceUserDetails.class, tdmceUserDetails.getUserid());
    em.remove(tdmceUserDetails);
    Where else can i look for the query?or for mysql i have to configure some property.

  • Don't get a result set from a query to mySql database

    Hello everyone,
    I am writing a program in which i refer to a mySql database.
    I encountered a problem using the executeQuery in which i don't get a resultSet at the end of the run,
    instead i get a null.
    gust for the record, the api says that it will never return null(se 6), also i queried the DB with a mySql client and the data is there
    and when i use execute("") everything works fine.
    I just can't get my wished result.
    the peace of code I am referring to is here, please feel free to say if you need more code...
    public static ResultSet getAccountResSet(int id) throws SQLException {
             //String query = "SELECT acctNum, acctOwnerId, acctOwnerName, balance, acctType, creditLimit, yearlyInterest, duration, creationDate, relatedCheckingAccoun FROM accounts WHERE acctNum="+id;
             String query = "select * from accounts where id="+id;
             ResultSet rs = statement.executeQuery(query);//this line falls, rs is null and i get null pointer exception
             return rs;
        }thanks for you help :)
    Edited by: gizmokaka on Mar 29, 2008 8:37 AM

    Maybe it's not the function executeQuery(query) that gives you the nullpointer. I think it may be that there is no connection to the DB, in which case the statement variable is null. Call to a method through this variable will trigger a nullpointer. Could you please post the exception text here? It may tell you where the NullPointerException occurs.
    //Chris

  • Inserting data into a MySQL database

    Hi. I am currently working on a group project and know very little about java to be honest
    I'm trying to insert records into a local MySQL database, but I'm having trouble.
    When the application is started, a connection is made to the database, which, as far as I can tell is successful. The user adds the data through a method in a console class which then passes the parameters to 'insertCustomer' method in class DatabaseIO.
    Connection code from DatabaseIO class
    public static void openDatabase(){
    //          start by making the connection
              try{
                   //System.out.println("setting up class");
                   Class.forName("com.mysql.jdbc.Driver");
              catch(Exception e){
                   System.out.println("Driver set up error" + e);
              try{
                   url="jdbc:mysql://localhost:3306/db0611426";
                   con=DriverManager.getConnection(url,"root","");
                   System.out.println("setting up database");
                   Opened = true;
              catch (Exception e){
                   System.out.println("database connection error"+ e);
         }Add customer form
    public void addCustomer() {
                        int customerID, depositPercentage;
                        String firstName, lastName, address, phoneNumber, add;
                        boolean purchaser;
                        double budget;
                        System.out.println("\n*** Enter Customer details: ***");
                        customerID = TextInputPrompt.getInteger("Customer ID Number: ");
                        firstName = TextInputPrompt.getString("First Name: ");
                        lastName = TextInputPrompt.getString("Last Name: ");
                        address = TextInputPrompt.getString("Address: ");
                        depositPercentage = TextInputPrompt.getInteger("Deposit Percentage");
                        budget = TextInputPrompt.getDouble("Budget");
                        purchaser = TextInputPrompt.getBoolean("Purchaser?");
                        phoneNumber = TextInputPrompt.getString("Phone Number: ");
                        add = TextInputPrompt.getString("Add Customer Y/N?: ");
                        if (!add.equalsIgnoreCase("y"))
                             return;
                        customers.addCustomers(new Customer(purchaser, customerID, firstName, lastName, address, phoneNumber, depositPercentage, budget));
                        DatabaseIO.insertCustomer(purchaser, customerID, firstName, lastName, address, phoneNumber, depositPercentage, budget);
              }Constructor in customer class
    public Customer(boolean purchaser,int customerID,String firstName,String lastName,String address,String phoneNumber,int depositPercentage,double budget) {
              super();
              this.purchaser = purchaser;
              this.customerID = customerID;
              this.firstName = firstName;
              this.lastName = lastName;
              this.address = address;
              this.phoneNumber = phoneNumber;
              this.depositPercentage = depositPercentage;
              this.budget = budget;
         }Code to insert customer into table (DatabaseIO class)
    //add a new customer to the customers table
         public static void insertCustomer(boolean purchaser,int customerID,String firstName,String lastName,String address,String phoneNumber,int depositPercentage,double budget){
             String query = "INSERT customer (purchaser,customerID,firstName,lastName,address,phoneNumber,depositPercentage,budget) VALUES ('"+purchaser+"','"+customerID+"','"+firstName+"','"+lastName+"','"+address+"','"+phoneNumber+"','"+depositPercentage+"','"+budget+"')";
             System.out.println("inserting "+ query);
             try{
                  Statement stmt = con.createStatement();
                  int rs = stmt.executeUpdate(query);
             catch (Exception e){
                  System.out.println("insert failed");
        }After entering the data, the 'insert failed' is displayed in the console. Any suggestions on how to solve the problem or any ways of finding out more about the exception would be very much appreciated, thanks in advance!

    Here's how to find out more about the exception:
    catch (Exception e){
      System.out.println("insert failed");
      e.printStackTrace();
    }

  • PHP MySQL database

    How to send a number count to the PHP MySQL database everytime a details page is opened from the results page?

    Assuming your DB table named 'stats' has fields for article_id, hits and the article id is passed to the detail page through the URL parameter article_id then your query would look like this:
    mysql_select_db($database_XXXXXX, $XXXXXX);
    if (isset($_GET['article_id'])) {
    $article_id = $_GET['article_id'];
    $query_hits = sprintf("UPDATE stats
    SET hits = hits+1
    WHERE article_id = %s", GetSQLValueString($article_id, "int"));
    $hits = mysql_query($query_hits, $XXXXXX) or die(mysql_error());

Maybe you are looking for

  • Itunes won't recognize apple id

    I can sign in to the Apple website and this forum, but iTunes won't recognize my apple ID. Any suggestions?

  • Lookup database in checkin screen

    Hi, My purpose is to have, on the checkin screen, a button near a field. When I click on this button, a lookup is done in an external database based on the value of the field. I developed a new component. In this component, I add a new service with t

  • Neo2+OC- Strange things happen to my mouse at teatime?

    Strange things happen to my mouse at teatime when the room heating kicks and the ambient temperature of the room increases approx 5° (system temp of 49 from 44 reported by SpeedFan). To compensate the fans in the Antec power supply automatically spee

  • Explorer.exe keeps crashing

    Firstly, apologies if I am posting at a wrong thread or if a thread is already existing with this issue. Issues: Explorer.exe keeps crashing after I installed an addin on my outlook 2007. The same Outlook addin on another computer with same Windows 7

  • Error during open or create a model

    Hello, I have the problem that I can not create or open a VC model. I get the error message Row: 2671 Charachter: 1 Error: '_root' is null or no object Code 0 Has anyone an idea?