mysql - PHP skip if the text field is empty? -


i have simple form updates columns in table, if text field in form empty, blanks out column in database. here ghostbined code of current script:

https://ghostbin.com/paste/jd9b9

basically, want if field empty, either ignored or not submitted or skipped.

thanks!

if (!empty($_post)) checks see if post array contains data @ all, means every insert statement trigger, if there one field set in post array. instead, need check each individual field see if set, , if has value you're interested in (ie, not empty string). or in other words:

change if (!empty($_post)) { if(isset($_post['username']) && $_post['username'] != '') {

for each of insert statements, , appropriate $_post key (username, description, etc)

for completeness
apparently, empty($_post['username']) work, opposed isset , subsequent check. comments