php: only register visit 1 per hour
<p>How can i only save one profilevisit per hour? So if you visited at 10:10 then it wont save when you view the profile at 12:10 ?</p>

<p>My code right now that saves evrytime you visit:</p>

<pre><code>$date = time();
$BuID= mysql_real_escape_string($v["id"]);
$uID= mysql_real_escape_string($showU["id"]);
mysql_query("INSERT INTO users_profilevisits (uID, BuID, date) VALUES ('$uID', '$BuID', '$date')") or
                die(mysql_error());
</code></pre>

<p>update</p>

<pre><code>function save(){
       mysql_query("INSERT INTO users_profilevisits (uID, BuID, date) VALUES ('$uID', '$BuID', '$date')") or
                die(mysql_error());
    $_SESSION['saved']=time();
 }

 if(isset($_SESSION['saved'])){
     $time = time();
     if($time-$_SESSION['saved'] &gt; 3600){
        save();
        }
 }else{
    save();
}
</code></pre>
