บทความ และเอกสารเผยแพร่
นับจำนวนผู้เยี่ยมชม
$host="localhost";
$username="root"; // user ??? root
$password="dv';bL;dii,"; // pass ??? Root ?????????????????????????
$db="counter";
$tb="counters";
mysql_connect( $host,$username,$password) or die ("?????????????????? Mysql ?????? ");
mysql_select_db($db) or die("????????????????????");
/* ???????????? Counter */
$sql1="Select * From $tb";
$dbquery1=mysql_db_query($db,$sql1);
$result1= mysql_fetch_array($dbquery1);
$counterkm=$result1[counterkm];
$ip=$result1[ip];
$date_sign= date("Y-m-d H:i:s");
echo "จำนวนผู้ใช้บริการ : $counterkm คน " ;
//echo $counter; // echo ?????? conter
/* ????? Update Counter ???+1 */
$counter_new=$counterkm+1;
$sql2="update $tb set counterkm='$counter_new'";
$dbquery2=mysql_db_query($db,$sql2);
mysql_close();
?>
|