<?php
$age1 = isset($_GET['age1']) ? $_GET['age1'] : "";
if ($age1 <= "18")
{
$sql = 'select * from events where type_id='.$id.' and id = "1"';
$tid = mysqli_query($conid, $sql);
}
else
{
$sql = 'select * from events where type_id='.$id.'';
$tid = mysqli_query($conid, $sql);
}
?>
-----------
<tr>
<td class="style1">Age:</td>
<td class="style2"><input type="text" name="age1" id="age1" class="form-control22" autocomplete="off"></td>
</tr>
<tr>
<td class="style1">Event Type:</td>
<td class="style2"><select name="event_id" class="ddl" id="event_id" onchange="geteventprice()">
<option value="0">--Select Event Type--</option>
<?php while($evt= mysqli_fetch_object($tid))
{
echo '<option value="'.$evt->id.'">'.$evt->name.'</option>'; } ?>
</select>
</td>
</tr>
else語句後是不工作...if語句不工作不給一個輸出
其不工作不是一個很好的解釋。 – Akintunde007
是這兩個不同的文件? –
如果語句不工作,因爲您對字符串值執行算術運算,即「18」 – Faraz