Pls help me with this...
//FINANCE.PHP
<form id="frmpay" name="frmpay" method="POST" action="finance_payment.php">
<input type="radio" name="seltour[]" value="<?php echo $tour_code; ?>">
<input type="submit" value="input" name="submit" />
</form>
once submitted..
//FINANCE_PAYMENT.PHP
if(isset($_POST['submit'])) {
for($i=0;$i<$numrow;$i++){
$code = [B]$_POST['seltour'][/B][$i];
$query = "SELECT tour_amount, tour_name FROM `tbl_tour_profile`
WHERE tour_code = '[B]$code[/B]'";
$result = mysql_query($query);
$requests = mysql_fetch_array($result);
$tour_name = $requests['tour_name'];
$budget = $requests['tour_amount'];
$query2 = "INSERT INTO`tbl_finance`
(`or_num`, `stud_num`, `tour_id`, `tour_name`,
`deposit`, `balance`, `teller_num`, `status`)
VALUES ('$code', '$tour_name', '$deposit')";
$result2 = mysql_query($query2);
if($result2){
$message = "transaction successful!"; alert_msg($message);
}else{
}
}
}
The code runs like this...
user will select TOUR using the radio button, put in an array, then submit.
Then in finance_payment.php, the array will be use to select the specific tour.
I dont know if my code is right. Im having errors saying:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\Main\finance_payment.php on line 14
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\Main\finance_payment.php on line 14
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\Main\finance_payment.php on line 14
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\Main\finance_payment.php on line 14
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\Main\finance_payment.php on line 14
pls help... thanks