Just Other Articles
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Create a simple hit counter using PHP and MySQL

Tags

  • password
  • brackets
  • tackle
  • phpthis script
  • correct username

  • Links

  • The Tell-Taler's Bible
  • Bathroom Design - The Call of Nature
  • Comparing Business Credit Cards For Profit
  • Just Other Articles - Create a simple hit counter using PHP and MySQL

    In this article I describe how to use PHP and MySQL to produce a simple counter that can be placed on a web page. PHP and MySQL work very well together, and this article shows, hopefully, how easy they are to use to produce a useful little utility.

    In order for the counter to work, the web server you upload the files to n
    According to USFDA, a combination product is one composed of any combination of a drug and device; biological product and device; drug and biological product
    eeds to support PHP and MySQL. Most good hosting solutions do.

    You can download the various scripts used to produce the counter from the following web address: http://www.computernostalgia.net/counter/counter.zip. The scripts are also listed below.

    The counter needs a database called 'counter', a table in that database c
    ; or drug, device, and biological product and fixed dose combination would include two or more combinations of drug.

    Examples of combination products may in
    lled 'countertable', and a field in the table called 'count'. If you want to use a different database, table, or field name, make sure you change the appropriate references to these names in the scripts.

    Files

    The zip file (counter.zip) contains the following files:

    • create_database.php<
    lude drug-coated devices, drugs packaged with delivery devices in medical kits, and drugs and devices packaged separately but intended to be used together.

    li>
  • create_table.php
  • reset_counter.php
  • counter.php


  • Note that for display considerations, in the following listings, opening and closing angle brackets for tag names ('<..>') are replaced by opening and closing square brackets ('[..]').

    create_database.php

    This
    here is enormous increase in the number of combination products entering the market in the recent years. Combination products have proven advantages but fixe
    script creates a MySQL database called 'counter'. Upload this script to your web server and run it first to create the database.

    [html][head][title]Create MySQL Database[/title][/head]
    [body]
    [?php


    //This script creates a database on the MySQL server.
    //The name of the database is counter.


    //Conne
    d dose combinations are still in the process of convincing regulatory authority on their advantages over the single ingredient formulations.

    Combination pro
    t to MySQL server
    $link = mysql_connect("localhost");


    //If you need to supply a username and password, then use the following line
    //of code instead of the one above, substituting the correct username and password.
    //$link = mysql_connect("localhost", "username", "password");


    //If the connection ca
    ucts have become life saving products for the pharmaceutical companies who doesn’t have many innovative molecules in their product pipeline and have been inc
    nnot be made, display an error message
    if (! $link)
    die("Cannot connect to MySQL");


    //Create a database called counter
    mysql_create_db("counter")or die("Error: ".mysql_error());


    //Close the connection to the MySQL server
    mysql_close($link);
    ?]
    [/body]
    [/html]


    create
    easingly used in the product life cycle management. Even the companies having product patents are trying to extend their product life cycle through the combi
    table.php

    This script creates a table (countertable) in the counter database. The table has one field, called 'count', which can store an eight digit number. This allows a counter value up to 99,999,999. Upload this and run it once the database has been created.

    [html][head][title]Create Table in Database[/title
    nation products and maximize the revenues. But the companies involved in this practice are overlooking that they are burdening the patients both economically
    [/head]
    [body]
    [?php


    //This script creates a table (countertable) in the database (counter).


    //Assign the name of the database (counter) to the variable $db.
    $db="counter";


    //Connect to MySQL server.
    $link = mysql_connect("localhost");


    //If you need to supply a username and password,
    and physically. They need to rightly judge the benefits of the combination products and they have to even look at the risks involved when combining the produ
    then use the following line
    //of code instead of the one above, substituting the correct username and password.
    //$link = mysql_connect("localhost", "username", "password");


    //If the connection cannot be made, display an error message.
    if (! $link)
    die("Cannot connect to MySQL");


    //Select the
    ts. Some of the combination products were well accepted by physicians while others suffered. Companies involved in development of combination products are fi
    atabase. If the database cannot be selected, display an error message.
    mysql_select_db($db , $link)
    or die("Select DB Error: ".mysql_error());


    //Create a table called countertable in the database.
    //The table contains one field: count, which should allow up to 99,999,999 hits
    mysql_query("CREATE TA
    ding difficulty in defining their combination products and facing various challenges from selecting a combination to marketing it.

    Following aspects would a
    BLE countertable( count INT(8))")or die("Create table Error: ".mysql_error());


    //Close connection to MySQL server.
    mysql_close($link);


    ?]
    [/body]
    [/html]


    reset_counter.php

    This script sets/resets the counter to zero. Upload this and run it to initialise the counter to zero. Y
    dd to the challenges in developing combination products:

    Which markets to tap where the combination products can do fairly well?
    Which combination prod
    u can run it at any time to reset the counter to zero.

    [html][head][title]Reset Counter[/title][/head]
    [body]


    [?php


    //Point your browser at this page to set/reset the counter to zero.


    $db="counter";


    $link = mysql_connect("localhost");


    //If you need to supply a username and password, then use
    cts are meaningful and rational?
    Which therapeutic categories to select?
    Which Combinations can address unmet needs of the patients?
    Do combin
    he following line
    //of code instead of the one above, substituting the correct username and password.
    //$link = mysql_connect("localhost", "username", "password");


    if (! $link) die("Cannot connect to MySQL");
    mysql_select_db($db , $link) or die("Cannot open $db: ".mysql_error());


    // Set the counter
    tions increase the patient compliance?
    What would be the developing cost?
    How to tackle the risks encountered during combination product developmen
    to zero
    mysql_query("INSERT INTO countertable (count) VALUES ('0')");


    //close link to MySQL server
    mysql_close($link);
    ?]


    [/body]
    [/html]


    counter.php

    This is the actual counter. The code in this file should be pasted into the web page that will contain the counter (or it
    t?

    As combination products don't fit into the traditional categories of drugs, medical devices, or biological products, the USFDA is in the process of devel
    can be run on its own). This web page, which will typically be part of a web site, must have a .php file extension, otherwise the PHP code will be ignored by the web server.

    [html][head][title]Increment Counter[/title][/head]
    [body]


    [comment]
    Include everything below this comment (down to the closing body t
    ping new procedures for reviewing their safety, efficacy and quality.

    Professional from academic institutions, pharmaceutical industries, health care indust
    ag) in the page
    on which you want to put the counter.
    [/comment]


    [?php


    //Set database to counter
    $db="counter";


    //connect to server and database
    $link = mysql_connect("localhost");


    //If you need to supply a username and password, then use the following line
    //of code instead of
    y and representatives from various regulatory agencies are working out to design the regulatory requirements for manufacture and sale of combination products
    he one above, substituting the correct username and password.
    //$link = mysql_connect("localhost", "username", "password");


    if (! $link) die("Cannot connect to MySQL");
    mysql_select_db($db , $link) or die("Cannot open $db: ".mysql_error());


    //Increment counter
    mysql_query("UPDATE countertable SET c
    .

    As there is an increasing trend of the combination products companies manufacturing such products should be able to tackle the problems involved in the de
    unt=count+1");


    //extract count from database table
    $counter = mysql_query("SELECT * FROM countertable");


    //Display counter. If you want to change the appearance of the counter, edit
    //the following table and font settings.
    print "[table border=1 cellpadding=3 cellspacing=0 width=80]";
    while ($
    elopment. They need to be wiser in analyzing the market trends and the regulatory requirements.

    Companies that provide selfless information through particip
    et_count = mysql_fetch_row($counter)){
    print "[tr]";
    foreach ($get_count as $field)
    print "[td align=right][font face=arial size=2]$field[/font][/td]";
    print "[/tr]";
    print "[/table]";
    }


    //close link to MySQL server
    mysql_close($link);
    ?]


    [/body]
    [/html]


    That's it


    tion in industry events and feedback to regulatory authorities would be able to face the challenges and will be successful in developing combination products

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.justotherarticles.org.ua/article/86610/justotherarticles-Create-a-simple-hit-counter-using-PHP-and-MySQL.html">Create a simple hit counter using PHP and MySQL</a>

    BB link (for phorums):
    [url=http://www.justotherarticles.org.ua/article/86610/justotherarticles-Create-a-simple-hit-counter-using-PHP-and-MySQL.html]Create a simple hit counter using PHP and MySQL[/url]

    Related Articles:

    Wholesale Directory Sources And Information On Suppliers

    Public Speaking: 3 Rules for PowerPoint Slides

    Ideal Subscription Fees

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com