Website hits tracker code in PHP MySQL
Website hits tracker code in PHP MySQL
This code of website hits tracker is developed in PHP and linked with MySQLi.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php $con = mysqli_connect("localhost", "root", "", "counter"); // retreive from database $sql = "Select * from counter"; $result = mysqli_query($con, $sql); $row = mysqli_fetch_assoc($result); $id = $row
['id']; $count = $row['count']; echo '<p>Count # ' . $count .' </p>'; $count = (int)$count; $count++; $sqlUp = "update counter set count = '$count'"; mysqli_query($con, $sqlUp); ?> |
Database view in PHP Myadmin