オプションを作成してフォームの一部と一緒に投稿するのに問題があります。HTMLのドロップダウンとPHPの動的作成
ここに私の現在のものがあります。 dbコネクタはすでに動作しています。
<select class="form-dropdown validate[required]" style="width:150px" id="input_5" name="account">
<?php
while($row = mysql_fetch_row($result)){
$bid =$row[0];
$account = $row[1];
echo '<option value="'.$bid.'>"'.$account.'"</option>"';
}
?>
</select>
それはに投稿はありません。私の問題は、課金ID(BID)は、それがに包まれているフォームと一緒に掲載されていないで、私はhtmlページ上の$入札をエコー場合
function calculateBilling(){
$date = date('mdY');
$bid = mysql_real_escape_string($_POST['bid']);
$account = mysql_real_escape_string($_POST['account']);
$timein = mysql_real_escape_string($_POST['timein']);
$desc = mysql_real_escape_string($_POST['desc']);
$hrs2calc1 = mysql_real_escape_string($_POST['hrly']);
$hrs2calc2 = mysql_real_escape_string($_POST['rhrly']);
$query = 'SELECT bid, account, hrly, rhrly, bal FROM billing WHERE bid="'.$bid.'"';
echo $query;
$result = mysql_query($query);
while($row = mysql_fetch_row($result)){
$accounttobebilled = $row[1];
$first = $row[2];
$second = $row[3];
$curbal = $row[4];
}
$sub1 = $hrly * $hrs2calc1;
$sub2 = $rhrly * $hrs2calc2;
$subtotal = $sub1 + $sub2;
$total = $curbal + $subtotal;
mysql_query("UPDATE billing SET bal = '" . $total . "' WHERE bid ='" . $bid . "'");
// Update Billing Log for this customer
mysql_query("INSERT INTO billingLog (bid, date, hrsOnsite, hrsRemote, timein, descript, total) VALUES ('$bid', '$date', '$hrs2calc1', '$hrs2calc2', '$timein', '$desc', '$subtotal')");
}
。私がそれを掲示する前に、それは上手く引っ張ります。上記の関数にはポストされません。 bidは整数です。
ありがとうございます!
出力されたHTMLを提供できますか? –
更新された質問 –