int main() { CDataBase* pDb = new CDataBase(); if(pDb->ExecuteSql("set names gbk") == 0) { printf("%s\n", pDb->GetLastErr()); return -1; } time_t now = time(NULL); char sql[100]; memset(sql, 0, 100); sprintf(sql, "update registerinfo set time=FROM_UNIXTIME(%d) where sn='1'", (long)now); if(pDb->ExecuteSql(sql) == 0) { printf("%s\n", pDb->GetLastErr()); return -1; } delete pDb; return 0; }