Posted by John MacLeod on 11/15/05 07:43
I'm trying to figure our how to execute a sql statement with a submit button
but I'm going in circles...
Here is the code I have come up with...
////// Reset database button /////////
echo"<form name=\"reset_database\" method=\"post\" action=\"<? $PHP_SELF
?>\">
<center><input type=\"submit\" name=\"enter_data\" value=\"Reset database
after printing\"></center>
</form>";
if ($enter_data) {
$sql = "UPDATE cubecartstore_order_inv SET order_from_supplier = '0'";
}
////// UPDATE `cubecartstore_order_inv` SET `order_from_supplier` = '0'
////// Reset database button /////////
I'm sure you can figure out what I'm trying to do, it's pretty simple. The
statement works in phpmyadmin but nothing happens with this form. Please go
easy on me as I'm very new to this. There's probably more then one thing I'm
missing but I have to start somewhere.
Any help would be greatly appreciated,
John
Navigation:
[Reply to this message]
|