Javascript If Variable Is Not Null Mysql Database