自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL數(shù)據(jù)庫來支持簡單的圖形計數(shù)器

數(shù)據(jù)庫 MySQL
我們今天要和大家一起分享的是用MySQL數(shù)據(jù)庫與GD來對簡單的圖形計數(shù)器進行支持的實際操作步驟,下面就是文章的主要內(nèi)容描述。

此文章主要向大家描述的是針對簡單的圖形計數(shù)器,我們?nèi)绾斡?a >MySQL數(shù)據(jù)庫與GD來對其進行支持的實際操作,以下的文章我是從一信譽度很好的網(wǎng)站上看見的,相信以下的文章會對很多人都會有所幫助。

<?php

hit_count表只一個字段hit_count

page_visit_record表是用來控制一個IP一天內(nèi)只產(chǎn)生一個計數(shù)器跳動

  1. CREATE TABLE page_visit_record (  
  2. visit_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,  
  3. remote_addr char(15) NOT NULL,  
  4. visit_page char(60) NOT NULL,  
  5. KEY visit_time (visit_time, visit_page),  
  6. Prima(最完善的虛擬主機管理系統(tǒng))RY KEY (visit_time)  
  7. );  
  8. ***/  
  9. include("config.inc.php3");  
  10. $query="select count(*) as tong from page_visit_record where remote_addr='$REMOTE_ADDR' and date_format(visit_time,'%Y-%m-%d')=curdate()";  
  11. $result=@MySQL(和PHP搭配之***組合)_query($query,$dbconnect);  
  12. $has_count=@MySQL(和PHP搭配之***組合)_result($result,0,"tong");  
  13. @MySQL(和PHP搭配之***組合)_query("lock tables hit_count write",$dbconnect);  
  14. $query="select * from hit_count";  
  15. $result=@MySQL(和PHP搭配之***組合)_query($query,$dbconnect);  
  16. if(@MySQL(和PHP搭配之***組合)_num_rows($result)>0){  
  17. $cur_count=@MySQL(和PHP搭配之***組合)_result($result,0,"hit_count");  
  18. if($has_count==0){  
  19. $cur_count++;  
  20. $query="update hit_count set hit_count='$cur_count'";  
  21. @MySQL(和PHP搭配之***組合)_query($query,$dbconnect);  
  22. }  
  23. @MySQL(和PHP搭配之***組合)_query("unlock tables",$dbconnect);  
  24. }  
  25. else{  
  26. $cur_count=1;  
  27. $query="insert into hit_count (hit_count) values ('$cur_count')";  
  28. @MySQL(和PHP搭配之***組合)_query($query,$dbconnect);  
  29. @MySQL(和PHP搭配之***組合)_query("unlock tables",$dbconnect);  
  30. }  
  31. while(strlen($cur_count)<8)  
  32. $cur_count="0$cur_count";  
  33. $visit_time=date("Y-m-d H:i:s");  
  34. $query="insert into page_visit_record (visit_time,remote_addr,visit_page) values ('$visit_time','$REMOTE_ADDR','$page')";  
  35. @MySQL(和PHP搭配之***組合)_query($query,$dbconnect);  
  36. Header("Content-type: image/gif");  
  37. $im = imagecreate(56,16);  
  38. $black = ImageColorAllocate($im, 0,0,0);  
  39. $blue = ImageColorAllocate($im, 0,0,255);  
  40. $white = ImageColorAllocate($im, 255,255,255);  
  41. $yellow = ImageColorAllocate($im, 255,255,0);  
  42. imagerectangle($im, 0, 0, 54, 14, $blue);  
  43. //imagestring($im, 2, 4, 1, $cur_count, $yellow);  
  44. imagestring($im, 2, 4, 1, $cur_count, $yellow);  
  45. ImageGif($im);  
  46. ImageDestroy($im);  
  47. ?> 

以上的相關內(nèi)容就是對簡單的圖形計數(shù)器需要MySQL,GD的支持的介紹,望你能有所收獲。

【編輯推薦】

  1. MySQL鏡像數(shù)據(jù)庫的正確建立在linux之下
  2. MySQL全文搜索索引的字段作用
  3. MySQL數(shù)據(jù)庫與表的最基本命令大盤點
  4. MySQL啟動方案匯總
  5. 453 h安裝在MySQL 4.1的亂碼問題
責任編輯:佚名 來源: 互聯(lián)網(wǎng)
相關推薦

2010-06-03 09:49:13

2010-07-15 15:50:58

安裝SQL Serve

2022-08-29 19:51:58

CSS計數(shù)器

2023-08-08 08:01:22

微服務架構服務

2015-06-23 13:56:30

數(shù)據(jù)庫設計面向對象

2024-03-04 08:53:50

海量數(shù)據(jù)計數(shù)器存儲

2009-11-06 16:59:26

WCF性能計數(shù)器

2023-07-28 08:15:27

PC程序計數(shù)器

2017-11-27 06:01:37

數(shù)據(jù)庫中間件中間層

2017-11-30 08:56:14

數(shù)據(jù)庫中間件架構師

2024-02-07 12:32:00

重構技巧PythonCounter

2009-06-11 16:27:18

科學型Java計數(shù)器

2009-11-25 15:07:39

PHP添加計數(shù)器

2011-03-21 17:00:23

MySQL數(shù)據(jù)庫

2011-03-31 17:02:19

MySQL數(shù)據(jù)庫遠程連接

2011-04-06 09:09:17

MySQL數(shù)據(jù)庫備份

2010-05-14 11:04:17

連接MySQL

2019-01-02 09:30:59

MySQL數(shù)據(jù)庫日志審計

2009-10-29 11:47:15

ADO.NET計數(shù)器b

2010-02-22 16:34:17

WCF性能計數(shù)器
點贊
收藏

51CTO技術棧公眾號