You are here: How do I execute sql with a submit button? « PHP SQL « IT news, forums, messages
How do I execute sql with a submit button?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация