我正在尝试将 plan_id 插入数据库,其中 plan_name =(从选择中选择)
你能帮我弄清楚这个片段有什么问题吗
<?php
$plan_id = ($a);
$query = "INSERT INTO tbl_reservation(cust_id, pack_type, plan_id, res_date, res_venue, date_app) VALUES ('{$cust_id}','{$pack_type}','{$plan_id}','{$res_date}','{$res_venue}',CURDATE())";
$result_set = mysql_query($query);
?>
<select name="plan_id">
<?php
$queryy = mysql_query("SELECT * FROM tbl_wed_plan");
while ($row = mysql_fetch_array($queryy)){
$plan_id = $row['plan_id'];
echo"<option value='.$row[plan_name].'>$row[plan_name]</option>";
}
$a = '';
if('plan_id' == 'Sho Minamimoto') {
$a = 'plan-01';
}else if('plan_id' == 'Janine Tugonon') {
$a = 'plan-02';
}else if('plan_id' == 'Jessie Jameson') {
$a = 'plan-03';
}else if('plan_id' == 'Karl Marx Bautista') {
$a = 'plan-04';
}
?>