0

in my form i am using an option Bloodgroup if user input is O+ mydatastring will be like this

name=phani&age=13&sex=male&bloodgroup=**o+**&phone=7864987540&[email protected]&city=akividu&area=donka street&pin=534235

In my database the value is storing as O and not as O+

2
  • And what exactly is your question? Commented May 27, 2012 at 20:46
  • We need the actual PHP code that stores the variables in the db. Commented May 27, 2012 at 20:49

1 Answer 1

1

I'm assuming this is a url. If so, use urlencode('O+') and enter its output (O%2B) in the url. Before entering the data in the database use urldecode() to change 'O%2B' to 'O+. Another thing you could do is assign each bloodgroup a number (O+ -> 0, A+ -> 1, ..., AB- -> 7) and then use a switch in your php code so that if bloodgroup == 1 enter O+ in the database and so forth.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.