From 56f2bdb24bf13c345e7b238857c39bd2ea6a925a Mon Sep 17 00:00:00 2001 From: pans <pans@454eff88-639b-444f-9e54-f578c98de674> Date: 星期四, 05 一月 2017 16:29:09 +0800 Subject: [PATCH] --- RtspFace/demo/src/DBuntil.cpp | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/RtspFace/demo/src/DBuntil.cpp b/RtspFace/demo/src/DBuntil.cpp index 027ace7..1c61e1a 100644 --- a/RtspFace/demo/src/DBuntil.cpp +++ b/RtspFace/demo/src/DBuntil.cpp @@ -3,15 +3,14 @@ #include <cstdio> #include <iostream> - -MYSQL myCont; -MYSQL_RES *result; -MYSQL_ROW sql_row; - -DBuntil::DBuntil() {} +DBuntil::DBuntil() { + +} DBuntil::DBuntil(my_db mydb) { + std::cout<<"DBuntil(my_db mydb) start"<<std::endl; + if(mysql_init(&myCont)!=NULL) { std::cout<<"init succeed"<<std::endl; @@ -25,6 +24,8 @@ } else std::cout<<"mysql_real_connect failed"<<std::endl; + + std::cout<<"DBuntil(my_db mydb) end"<<std::endl; } DBuntil::~DBuntil() @@ -54,7 +55,11 @@ std::cout<<"per->f_id="<<per->f_id<<std::endl; std::cout<<sql<<std::endl; std::cout<<"==========end=============="<<std::endl; - mysql_query(&myCont, "SET NAMES utf8"); //璁剧疆缂栫爜鏍煎紡 + if(!mysql_query(&myCont, "SET NAMES utf8"))//璁剧疆缂栫爜鏍煎紡 + { + std::cout<<"SET NAMES utf8"<<std::endl; + }else + std::cout<<"SET NAMES utf8 failed"<<std::endl; res = mysql_query(&myCont,sql);//鏌ヨ if (!res) { -- Gitblit v1.8.0