finally got to pass javascript variable to database. after 3 days. success.