I'll keep it simple... this is actually the code I'm using to populate a dropdown menu from the database. This populates the dropdown menu properly.

<form action="formsubmit.php?team_id=6" method="post">
    <label> <br />What did they say?: <br />
        <textarea name="quotetext" rows="10" cols="26"></textarea></label>
    <select name='name'>
            while ($temp = mysql_fetch_assoc($query)) {
                echo "<option value=" . $temp['id'] . ">".htmlspecialchars($temp['lastname']) . ", " . htmlspecialchars($temp['firstname']) . "</option>";
    <input type="submit" value="Submit!" />

What I am trying to complete is pass the individual's ID into along towards the file formsubmit.php that is known as around the submission from the form. After I use $die($sql) on my small database query in formsubmit.php, the ID of the individual is blank.... anything else will get passed through all right. This is actually the relevant code in formsubmit.php:

$quotetext = $_POST['quotetext'];
    $id = $_POST['id'];
    $team_id = $_GET['team_id'];
    $sql = "INSERT INTO quotes SET 

EDIT: Fixed, credit to Michael.

<select name='name'>

Ought to be:

<select name='id'>

Initially, it appears just like a typo. Try:

$id = mysql_real_escape_string($_POST['name']);

Inside your form, you're using <select name='name'>, however in your PHP script you are with $_POST['id']. Change it out to:

<select name='id'>

However , you do not have an application variable with "id" since it's title. It appears in my experience as you need to simply change <select name='name'> to <select name='id'>.

$team_id = $_POST['name']

Your choose element is known as "title" as well as your form is "Publish".

You have to change

$id = $_POST['id'];


$id = $_POST['name']; // as name is what you gave your select element