SA-MP Forums Archive
Field equals null - 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: Field equals null (/showthread.php?tid=589046)



Field equals null - nezo2001 - 14.09.2015

How to check if fields equal null, I've enabled it to be null in the database. But how to check if it is null or not because in some cases it may handle data.


Re: Field equals null - Vince - 14.09.2015

Altering the query to handle such cases is probably the easiest, you can use IFNULL() for that. It can be handled in Pawn as well, but I don't think it's as neat because it requires string comparison which is very slow.


Re: Field equals null - nezo2001 - 14.09.2015

So, will IFNULL works in samp. And if yes, Should I retrive the data and store it in the string then do
PHP код:
if(IFNULL(string)) 
OR?


Re: Field equals null - Vince - 14.09.2015

Searching the term on ****** is such an incredibly hard job, indeed. https://dev.mysql.com/doc/refman/5.0...unction_ifnull