Shadow Blade
Morrowland Presents Apron Tutorials
game - design - multimedia - web - programming - tutorials - There are currently viewers visiting Apron Tutorials.
   
 
TECHNICAL
GRAPHICAL
SOUND
GAME
WEB
ARTICLE
TOOL
PROJECT
 
 NEWS

  news

  history


 TECHNICAL TUTORIALS

  opengl

  direct3d

  c/c++

  visual basic

  java

  c#


 WEB TUTORIALS

  html

  dhtml

  asp

  php


 IMAGE EDITING

  photoshop

  draw sketch


 3D MODELING

  3d studio


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 DEMOS

  win32 api


 ARTICLES

  general

  opengl


 COMMUNITY

  about us

  credit

  contact






YOUR HIT COUNTER IN PHP
I will in this tutorial show you how to make a hit counter, using a MySQL database.



Making the Hit-counter

When a user enters your site, you have to update the table in your database. I have called my table for tbHits and the database for dbHits. If you are not familiar to the connect functions or the SQL statements, this tutotrial will show you the basics.

//connecting to the db
$host = "localhost";
$username = "apron";
$password = "apron123";
$database = "dbHits";
$server = mysql_connect($host, $username, $password);
$connection = mysql_select_db($database, $server);

//get the recordset with SQL
$rs = mysql_query("SELECT * FROM tbHits");
$viewers = 0;
//update the table
if($row=mysql_fetch_assoc($rs))
{
  $viewers = $row[Viewers] + 1;
}

//update the tbHits table
$sql = mysql_query("UPDATE tbHits SET Viewers = '$viewers'");

//close the db connection
mysql_close($server);

//display the viewers
echo($viewers);



PROJECT DESCRIPTION
Category Programming with PHP
Author Tommy Johannessen





Ronny André Reierstad
Morrowland All rights reserved Morrowland © 2002 Apron Tutorials

 LINKS

  morrowland home



 GAME DEVELOPEMENT

  nvidia

  gamedev

  polycount


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 MATH AND PHYSICS

  mathworld

  physicsworld







PLEASE LINK TO


  All rights reserved Morrowland © 2007  
Ronny André Reierstad