毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> WEB开发 >> 正文

boa+cgi+sqlite3基于web的数据采集并动态显示

更新时间:2012-6-14:  来源:毕业论文

开发板是TQ2440,linux系统
移植了boa,sqlite3,cgic
现在,应用程序每秒钟,将采集的数据如温度、湿度等,写入到数据库。
问题:用cgi,如何动态显示所产生的温度、湿度。【不要用刷新】

定时ajax调用你的cgi程序 我定时刷新的cgi程序如下:
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>

int main()
{
  sqlite3 *pdb=NULL;
  sqlite3_stmt *stmt;
  char *szErrMsg=0;
  int rc,i;
  rc=sqlite3_open("/home/dyh/date.db",&pdb);
  if(rc)
  {
  fprintf(stderr,"can't open database: %s",sqlite3_errmsg(pdb));
  sqlite3_close(pdb);
  return -1;
  }
  printf("Content-type:text/html\n\n");
  printf("<html>\n<head>\n<Meta http-equiv=\"Refresh\" Content=\"1;\"><title>test</title></head>\n<body>\n");
  printf("<h1 align=\"center\">dongtai</h1>\n");
  printf("<table border=\"1\" align=\"center\">\n");
  printf("<tr>\n");
  printf("<th>id</th><th>dev</th><th>wendu</th><th>time</th>\n");
  printf("</tr>\n");

  char sql[512];
  //char *sql="select *from wsd where id=(select max(id)from wsd where dnum=1)";

[1] [2] 下一页

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。