Home > database >  User input in the input box gender male, save to the database of sex field data into 1, female gende
User input in the input box gender male, save to the database of sex field data into 1, female gende

Time:10-24

As shown in figure, the user input box enter male
Automatically replaced by 1 to the database user list
How do you write with the insert SQL statements.

CodePudding user response:

Bosses help me wow

CodePudding user response:

Insert into t (sex)
Select case when box value='male' then the when box 1='female' then 2 else 'illegal' input end


In case the when then the else end

CodePudding user response:

This should not let people fill out, can only let him choose,

Use the drop-down list or radio, so people chose is the corresponding value, need not worry behind,
In addition, you use a text box, the somebody else blind fill you can't handle,

So don't everything database, this is not a database,

CodePudding user response:

Directly in the program end turned not to go, even into the database? Input box there is good just a matter of mapping
  • Related