Quantcast
Channel: User user3040610 - Stack Overflow
Viewing all articles
Browse latest Browse all 44

Answer by user3040610 for Page count function

$
0
0

Get the results and check whether it has records.

  // Check to see if record exists    $sql = "SELECT * FROM page_tracking where name ="index.php"";    $query = mysqli_query ($conn, $sql);    $result=mysqli_fetch_all($query,MYSQLI_ASSOC);    if (count($result) > 0) {        $sql= "UPDATE page_tracking SET count=count+1 where name="index.php")";    }    else {    //Insert Query    $sql = "INSERT INTO page_tracking (name, count)    VALUES ('index.php', '1')";     }

Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>