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
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);

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>";

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.