Ok, so I am adding data to a field.
If the field is null add a value. If the field is not null, add the value prepended with a comma.
So I tried this to make sure it worked, but it doesn't:
SELECT IF(IS NULL(`vg_user_data`.`friends_list`), '2', ',2')
The above was just for a simple test, not the statemnet I would use.
Now why would that not work?
If 'IS NULL' returns true, select '2' else select ',2'.
Problem is I get this error every time:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NULL(`vg_user_data`.`friends_list`), '2', ',2')' at line 1
I could check the field first, but why use two db calls when I should be able to do it in one?!
Thanks for any help.