Jump to content

[SOLVED] add to sql result


bhawap

Recommended Posts

ok see rite now my sites hit counter is counted from the mysql visitor log    i need to clear it after atleast 20 000 but i dont wana loose the count this is how i get the count now how do i add 20 000 to it if i clear the sql data base

 

 

$SqlResult = MySqlSelect("Select * From traffic_log");
$RowCnt = mysql_numrows($SqlResult);

Link to comment
https://forums.phpfreaks.com/topic/178468-solved-add-to-sql-result/
Share on other sites

ok see rite now my sites hit counter is counted from the mysql visitor log    i need to clear it after atleast 20 000 but i dont wana loose the count this is how i get the count now how do i add 20 000 to it if i clear the sql data base

 

please help me with this

 

Thanks in advance

Zainul

 

$SqlResult = MySqlSelect("Select * From traffic_log");
$RowCnt = mysql_numrows($SqlResult);

well then you may need to try something like this example

 

example

$i = 0;  //set this to where you want to start
  while($test = mysql_fetch_array($result))
  { echo $test['some_field']; // list whatever 'somefield' 
    echo "<br>"; // returns blank line
    $i++; // increments counter by 1
  }
  echo $i; // outputs what the current counter value

this is how i do it rite now how do i add that so i can add the 20000 in it then del everything from the mysql database

 

<?php

if ($GetHitCount != "False") {

$SqlResult = MySqlSelect("Select * From traffic_log");

$RowCnt = mysql_numrows($SqlResult);

//counter string replace

$counterstr = str_replace("0",'<img src="Images/Hit-counter/computer/0.gif" border="0" alt="" />',$RowCnt);

$counterstr = str_replace("1",'<img src="Images/Hit-counter/computer/1.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("2",'<img src="Images/Hit-counter/computer/2.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("3",'<img src="Images/Hit-counter/computer/3.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("4",'<img src="Images/Hit-counter/computer/4.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("5",'<img src="Images/Hit-counter/computer/5.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("6",'<img src="Images/Hit-counter/computer/6.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("7",'<img src="Images/Hit-counter/computer/7.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("8",'<img src="Images/Hit-counter/computer/8.gif" border="0" alt="" />',$counterstr);

$counterstr = str_replace("9",'<img src="Images/Hit-counter/computer/9.gif" border="0" alt="" />',$counterstr);

 

echo' <center><font face="Verdana" size="2"><b> Visitor Number</b> </font></a></center>'."\n";

echo " <center>" . $counterstr . "</center>";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.