How does PAWN deal with NULL returns from a MySQL database?
#9

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Included in a_mysql:


Example:
pawn Код:
new
    probablyNullField[64]
;
cache_get_row(0, 0, probablyNullField, 1, 64);
if(ismysqlnull(probablyNullField)) {
    print("Oh my, that field was null!");
} else {
    printf("That field wasn't null, and its contents are: %s", probablyNullField);
}
Cache_get_*_int/float probably automagically convert null to 0, so if you have nullable field with distinct reason for null usage, use the former version.
Alright, thank you for the detailed explanation.
+REP
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)