|
|
|
จำนวนรายการสินค้า |
236 รายการ |
สถิติ |
//*** By Weerachai Nukitram ThaiCreate.Com ***//
//*** Connect MySQL ***//
mysql_connect("localhost","ezcomya_ezadmin","XCw2oCdOH");
mysql_select_db("ezcomya_ezcomya");
//*** Select Çѹ·Õèã¹µÒÃÒ§ Counter ÇèһѨ¨ØºÑ¹à¡çº¢Í§Çѹ·Õèà·èÒäËÃè ***//
//*** ¶éÒà»ç¹¢Í§àÁ×èÍÇÒ¹ãËé·Ó¡Òà Update Counter ä»ÂѧµÒÃÒ§ daily áÅÐź¢éÍÁÙÅ à¾×èÍà¡çº¢Í§Çѹ»Ñ¨¨ØºÑ¹ ***//
$strSQL = " SELECT DATE FROM counter LIMIT 0,1";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult["DATE"] != date("Y-m-d"))
{
//*** ºÑ¹·Ö¡¢éÍÁÙŢͧàÁ×èÍÇÒ¹ä»ÂѧµÒÃÒ§ daily ***//
$strSQL = " INSERT INTO daily (DATE,NUM) SELECT '".date('Y-m-d',strtotime("-1 day"))."',COUNT(*) AS intYesterday FROM counter WHERE 1 AND DATE = '".date('Y-m-d',strtotime("-1 day"))."'";
mysql_query($strSQL);
//*** ź¢éÍÁÙŢͧàÁ×èÍÇҹ㹵ÒÃÒ§ counter ***//
$strSQL = " DELETE FROM counter WHERE DATE != '".date("Y-m-d")."' ";
mysql_query($strSQL);
}
//*** Insert Counter »Ñ¨¨ØºÑ¹ ***//
$strSQL = " INSERT INTO counter (DATE,IP) VALUES ('".date("Y-m-d")."','".$_SERVER["REMOTE_ADDR"]."') ";
mysql_query($strSQL);
//******************** Get Counter ************************//
// Today //
$strSQL = " SELECT COUNT(DATE) AS CounterToday FROM counter WHERE DATE = '".date("Y-m-d")."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strToday = $objResult["CounterToday"];
// Yesterday //
$strSQL = " SELECT NUM FROM daily WHERE DATE = '".date('Y-m-d',strtotime("-1 day"))."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strYesterday = $objResult["NUM"];
// This Month //
$strSQL = " SELECT SUM(NUM) AS CountMonth FROM daily WHERE DATE_FORMAT(DATE,'%Y-%m') = '".date('Y-m')."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strThisMonth = $objResult["CountMonth"];
// Last Month //
$strSQL = " SELECT SUM(NUM) AS CountMonth FROM daily WHERE DATE_FORMAT(DATE,'%Y-%m') = '".date('Y-m',strtotime("-1 month"))."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strLastMonth = $objResult["CountMonth"];
// This Year //
$strSQL = " SELECT SUM(NUM) AS CountYear FROM daily WHERE DATE_FORMAT(DATE,'%Y') = '".date('Y')."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strThisYear = $objResult["CountYear"];
// Last Year //
$strSQL = " SELECT SUM(NUM) AS CountYear FROM daily WHERE DATE_FORMAT(DATE,'%Y') = '".date('Y',strtotime("-1 year"))."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strLastYear = $objResult["CountYear"];
//*** Close MySQL ***//
// mysql_close();
?>
วันนี้ |
0 |
เมื่อวาน |
0 |
เดือนนี้ |
0 |
เดือนที่แล้ว |
0 |
ปีนี้ |
0 |
ปีที่แล้ว |
0 |
|
ปรับปรุงราคาล่าสุด |
0000-00-00
|
|
|
|
|
|