Best approach to run queries only when user chooses

Best approach to run queries only when user chooses

am 24.10.2005 15:58:35 von Ian Davies

Hello
I am trying to run a few INSERT queries only if the user clicks 'continue'
in a The queries takes variables created from SELECT queries. I
have tried to acheive this by putting The INSERT queries into a function at
the top of my php file and having the SELECT queries below it. I have a
message that pops up that includes a link to the function but I cant get
this to work and am not sure of the best approach. Can anyone help?
My striped down code is below. Im not even sure if you can just use a
function to contain code that doesnt return a value. Mine just runs some
INSERT INTO queries

************************************************************ *******
function PurchaseQuestions(){

various INSERT INTO queries here

Confirmation



or return to
Questions Database





Congratulations , your order has
been completed.



}
?>


$OrderDate = date('d/m/Y');

Three SELECT queries here which provides variables for the
PurchaseQuestions() function
?>

Order Status


You have requested questions at a total cost
of £
If you wish to proceed with the transaction click PurchaseQuestions() ?>> Continue.


}

?>
mysql_close($conn);
?>