I want to submit drop-down with dynamic value. I concatenate all variables inside the string but data not submit any one help me how is it done
if(isset($_POST['submit'])){
$name = $_POST['name'];
$value1 = $_POST['value1'];
$value2 = $_POST['value2'];
$data = "<select name=''$name''>";
$data .="<option>Selet data</option>";
$data .="<option value='**$value1**'> **$value1**</option>";
$data .="<option value='**$value2**'> **$value2**</option>";
$data .="</select>";
mysql_query("insert into options (value) values ('".$data."')");
}
With variable string not submit in to the database.
HTML is below
<form action="" method="POST">
<input type="text" name="name">
<input type="text" name="value1">
<input type="text" name="value2">
<input type="submit" name="submit">
</form>
mysql_functions they are deprecated since php 5.5.0mysql_error()is undoubtedly telling you about the problem, you should check that for errors. While not necessarily a duplicate, this would be a great place for you to start: stackoverflow.com/questions/60174/…