私はここでは初めてで、PHP はまったく初めてです。私は自分の問題の解決策を少し探しましたが、私が見つけたケースはどれも私のものとまったく同じではありません.
データベースの値を HTML ドロップダウン ボックスにフィードしようとしていますが、データベースから特定の行が必要です。
Atm 私のコードは次のようになります。
$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>";
}
}
変な変数名でごめんなさい。私はこれを終わらせるのに少し急いでいます。