From dfa10a0616074fd82703516a2d3ef0f44cac64ab Mon Sep 17 00:00:00 2001
From: pans <pans@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 30 十二月 2016 18:20:34 +0800
Subject: [PATCH] 

---
 RtspFace/demo/src/db/main.cpp |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/RtspFace/demo/src/db/main.cpp b/RtspFace/demo/src/db/main.cpp
index 179c7b4..a9304df 100644
--- a/RtspFace/demo/src/db/main.cpp
+++ b/RtspFace/demo/src/db/main.cpp
@@ -1,4 +1,3 @@
-
 #include <string>
 #include <iostream>
 
@@ -10,8 +9,16 @@
 int main(int argc, char *argv[])
 {
 	int i=2;
-	DBuntil dbu = DBuntil();
-	person p={};
+	my_db mydb={"root","Basic@2017","localhost","demo",3306};
+	
+	DBuntil dbu = DBuntil(mydb);
+	person p={0,"test"};
+	if(dbu.db_register(i,&p)){
+		cout<<"add succeed"<<endl;
+	}else
+		cout<<"add false"<<endl;
+	p={};
+	
 	p = dbu.db_rearch(i);
 	if(p.p_id != NULL)
 	{
@@ -19,5 +26,6 @@
 		cout<<p.name<<endl;
 	}else
 		cout<<"person is null"<<endl;
+	
 	return 0;
-}
\ No newline at end of file
+}

--
Gitblit v1.8.0