I am new here, and quite new to PHP. I have done a bit of searching for a solution to my problem but none of the cases I find are quite like mine.
I am attempting to feed database values into a HTML drop down box, but I need very specific rows from my database.
Atm my code looks like this:
$query ="SELECT Email FROM circle WHERE Circle_num=$circle_num";
$query_get = mysql_query($query,$conn);
if(!$query_get) {
die("Unable to execute query $query" );
}
echo "<select name='circle_users'>";
while ($temp = mysql_fetch_assoc($query_get)) {
echo "<option value='".$temp['Email']."'>";
$temp_email = $temp['Email'];
$temp_query = "SELECT firstname, lastname FROM user WHERE email=$temp_email";
if(!$temp_query) {
die("Unable to execute query $temp_query");
}
$get_temp_query = mysql_query($temp_query,$conn);
$temp2 = mysql_fetch_assoc($get_temp_query);
echo $temp2['fistname']." ".$temp2['lastname']."</option>";
}
}
Sorry about the bad variable names. I am in a little bit of a hurry to finish this.