SA-MP Forums Archive
Detecting NULL Query Result Values - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Detecting NULL Query Result Values (/showthread.php?tid=302579)



Detecting NULL Query Result Values - -Cyclone- - 09.12.2011

Hi,

I have noticed that if I use the 'db_get_field' function and the field of my result set which I am trying to get contains a NULL value, then the use of the 'db_get_field' function will crash my server. Apparently you cannot get a field which contains a NULL value.

So, does anyone know of any way that I can detect if a field (or even an entire result set) has a NULL value present without using a plugin that goes beyond SQLite? My case is such that the result set may or may not contain a NULL value and I do not always know if it will or not.


Re: Detecting NULL Query Result Values - MadeMan - 09.12.2011

Better use default values for columns, so they won't be NULL.