19.01.2014, 07:33
Hello
Does anyone have a way to check that is field exists in sqlite database?
@EDIT
Is there faster way?
Does anyone have a way to check that is field exists in sqlite database?
@EDIT
Is there faster way?
Код:
new DBResult:fieldsCheck = db_query(serverDB, "SELECT * FROM `"PREFIX"players` LIMIT 1"), numFields = db_num_fields(fieldsCheck), bool:dataExists = false; for(new field=0; field<numFields; field++) { new fieldName[64]; db_field_name(fieldsCheck, field, fieldName, sizeof(fieldName)); if(!strlen(fieldName)) continue; if(!strcmp(fieldName, data, true)) dataExists = true; } } db_free_result(fieldsCheck);