Ratna Fang Member Licensed User Longtime User Jun 4, 2014 #1 hi erel, i have a table in mysql which has 2 fields, varchar (string, isn't it?), and contains null value. i can retrieve using json. but i don't have any idea how to catch the null value. this is my simple code: Code: Copy Ph1=M.Get("Phone") HP=M.Get("HP") and this is what i tried: Code: Copy If Ph1="" OR Ph1=" " OR Ph1=Null Then CallBtn.Visible=False PhoneTarget="" Else CallBtn.Visible=True PhoneTarget=Ph1 End If i tried several tricks from "", " " (a space between), and Null to catch the null but it didn't work. could you give me a simple code how to catch null value which retrieved from mysql database using json? thanks
hi erel, i have a table in mysql which has 2 fields, varchar (string, isn't it?), and contains null value. i can retrieve using json. but i don't have any idea how to catch the null value. this is my simple code: Code: Copy Ph1=M.Get("Phone") HP=M.Get("HP") and this is what i tried: Code: Copy If Ph1="" OR Ph1=" " OR Ph1=Null Then CallBtn.Visible=False PhoneTarget="" Else CallBtn.Visible=True PhoneTarget=Ph1 End If i tried several tricks from "", " " (a space between), and Null to catch the null but it didn't work. could you give me a simple code how to catch null value which retrieved from mysql database using json? thanks
stevel05 Expert Licensed User Longtime User Jun 4, 2014 #2 Is M a map? If so you can use GetDefault("Phone","") and it will return the default value supplied instead of the Null. An empty string ("") in this case. Upvote 0
Is M a map? If so you can use GetDefault("Phone","") and it will return the default value supplied instead of the Null. An empty string ("") in this case.
Ratna Fang Member Licensed User Longtime User Jun 4, 2014 #3 stevel05 said: Is M a map? If so you can use GetDefault("Phone","") and it will return the default value supplied instead of the Null. An empty string ("") in this case. Click to expand... many thanks stevel that helps me alot Upvote 0
stevel05 said: Is M a map? If so you can use GetDefault("Phone","") and it will return the default value supplied instead of the Null. An empty string ("") in this case. Click to expand... many thanks stevel that helps me alot