<select name="Industry" id="Industry" >
<option value="">Select Industry</option>
<option value="2">Account/Finance</option>
<option value="3">Advertising</option>
.
.
</select>
<select name="Functional_Area" id="Functional_Area">
<option value="">Select Functional Area</option>
</select>
Drop down list Industry and Fucntional_Area get values from database ie.industry_id and industry_name..ids as you know 1,2,3,4 and respective names .
when I try to save ddl selected text to database It's id value example 2 get saved to database
php code:
$Industry=mysql_escape_string($_POST['Industry']);
$insert_query=("INSERT INTO profile_experience_info (industry) values ($Industry)");
mysqli_query($conn,$insert_query);
I am a ASP.NET developer where I use to use ddl.Selectedtext property to save selected text to database but i am not getting how to do this in php .. i tried a lot and also donot want to change id's value to match option value which I mostly found on google ,
eg) I don't want to do this as in my project I have lot of ddl whos db is ready with tons of data..
<select name="Industry" id="Industry" >
<option value="">Select Industry</option>
<option value="Account/Finance">Account/Finance</option>
<option value="Advertising">Advertising</option>
.
.
</select>
plz suggest some another solution to save user selected text to db
Please help me in this
Thk in advance ..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…