Forum Moderators: coopster
<?php
$resultVs = mysql_query("SELECT views FROM page LIMIT 1") or die(mysql_error());
while($rVs = mysql_fetch_array($resultVs)) { $viws = $rVs['views']; } $viws = ($viws+1);
mysql_query("UPDATE page SET views='$viws'") or die(mysql_error());
?> <?php
mysql_query("UPDATE page SET views=(views+1)") or die(mysql_error());
?>
This will update all page records in the table though - i dont know how your system is setup but you might want to specify which record you want to update eg.
<?php
mysql_query("UPDATE page SET views=(views+1) WHERE pageName = 'homepage'") or die(mysql_error());
?>
Hope this helps
Ally
// LANGUAGE: "Simplified Jargon"
//// AUTHOR: "NAME HERE"
/// VERSION: "3.0.1"
///// TITLE: "INDEX_DUMP.LOG"
== RUN INDEX PAGE
== PHP CODE INITIALIZED ENTITLED "?"
== PHP CODE IF STATEMENT
== PHP CODE IFTRUE REDIRECT PAGE TO \nINDEX
== PHP CODE IFTRUE PROCESS PAGE INDEX
== PHP CODE IFTRUE PROCESS PAGE INDEX&&'res/inc/home.php'
== PHP CODE IFFALSE PROCESS PAGE INDEX&&'res/inc/404.php'
[edited by: not2easy at 11:44 am (utc) on Aug 20, 2026]
[edit reason] privacy [/edit]