将DropDown值插入MYSQL

This is my html form and php file i have to insert my budget dropdown values by select into database i have to select values from budget and selected value can insert in database and my data is inserting in my database when i click twice on submit button

<form action="insert.php" method="post" id="register-form" onsubmit=" return add();">
    <div class="label"> Name</div><input type="text" id="name" name="name" /><br />
    <div class="label">Email</div><input type="text" id="email" name="email" /><br />
    <div class="label">Phone Number</div><input type="text" id="phone" name="phone" /><br />
    <div class="label">budget</div>
    <select id="budget" name="budget">
        <option value="">select</option>
        <option value="1">0-100</option> <!-- first option contains value="" -->
        <option value="2">100-200</option> 
        <option value="3">200-300</option> 
    </select>
    <br /><br />
    <input type="submit"  onclick="add()" name="submit" />
    <div id="message"></div>
</form>

insert.php

<?php
    include("config.php");
    if(isset($_POST['submit'])){
       $name=$_POST["name"];
       $email=$_POST["email"];
       $phone=$_POST["phone"];
       $budget=$_POST["budget"];
       $insert_query="insert into form(name,email,phone,budget) values ('$name','$email','$phone','$budget')";
       $con=mysql_query($insert_query);
    }

?>

dropdown pass option value in variable so change the option value which you want to insert in database

<select id="budget" name="budget">
            <option value="">select</option>
            <option value="0-100">0-100</option> <!-- first option contains value="" -->
            <option value="100-200">100-200</option> 
            <option value="200-300">200-300</option> 
        </select>

Do the following:

<select id="budget" name="budget">
            <option value="">select</option>
            <option value="0-100">0-100</option> <!-- first option contains value="" -->
            <option value="100-200">100-200</option> 
            <option value="200-300">200-300</option> 
        </select>

Ensure that your field in the database is string/varchar

Re-visit the add() as well. That might be the cause for inserting successfully after the second click.

<select id="budget" name="budget">
 <option value="">select</option>
 <option value="0-100">0-100</option> <!-- first option contains value="" -->
 <option value="100-200">100-200</option> 
 <option value="200-300">200-300</option> 
 </select>

if u want to select multiple option u use

<select id="budget" name="budget" multiple="multiple">

The $_POST["budget"]; is taking the value that is in the option, in this case the value for "0-100" is 1. If you want the value to be stored in the database use "0-100" as the value.

As far as the insert problem goes, try using this syntax:

$budget=$_POST['budget'];
$query = "INSERT INTO users ( database_budget )
        VALUES ('$budget');";

the top value being the value in the database and the bottom value being the post value.

This is assuming that you're connecting to the database correctly. Also use single quotes for post values not double quotes.