Is there a way to set an IF statement in MySQL or PHP to write something to a column or not? What I want to do is completely skip a column so that "NULL" is written to it, in case there is no data to be submitted in the column.
In case nothing is to be submitted to the database in one column, I want it to be NULL for that record obviously. Right now, in each column where there is no data, it's just empty.
I could ofcourse set a completely new variable with a new query and all, and just skip that column in the query, but in my case, it'd be tons of more (probably) unnecessary code.