mirror of
				https://github.com/lxsang/ant-http
				synced 2025-10-31 02:15:45 +01:00 
			
		
		
		
	fix db access bug
This commit is contained in:
		| @@ -135,7 +135,7 @@ dbrecord dball(sqlite3* db,const char* table) | |||||||
| dbrecord dbselect(sqlite3* db, const char* table, const char* fname,const char* fstring,...) | dbrecord dbselect(sqlite3* db, const char* table, const char* fname,const char* fstring,...) | ||||||
| { | { | ||||||
| 	char* sql; | 	char* sql; | ||||||
| 	char* prefix = "SELECT (%s) FROM %s WHERE %s"; | 	char* prefix = "SELECT %s FROM %s WHERE %s"; | ||||||
| 	char* cond; | 	char* cond; | ||||||
| 	va_list arguments;  | 	va_list arguments;  | ||||||
| 	int dlen; | 	int dlen; | ||||||
| @@ -180,7 +180,7 @@ dbrecord dbselect(sqlite3* db, const char* table, const char* fname,const char* | |||||||
| int hastable(sqlite3* db,const char* table) | int hastable(sqlite3* db,const char* table) | ||||||
| { | { | ||||||
| 	//char * prefix = __s("type='table' and name='%s'",table); | 	//char * prefix = __s("type='table' and name='%s'",table); | ||||||
| 	dbrecord rc = dbselect(db,"sqlite_master","type='table' and name='%s'", table); | 	dbrecord rc = dbselect(db,"sqlite_master","*","type='table' and name='%s'", table); | ||||||
| 	//free(prefix); | 	//free(prefix); | ||||||
| 	if(!rc) return 0; | 	if(!rc) return 0; | ||||||
| 	if(!rc->fields) | 	if(!rc->fields) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user