James wrote:
What is the best way to update a record in a MYSQL DB using a FORM and PHP
?
Where ID = $ID !
Any examples or URLS ?
Thanks
$query = " UPDATE table_name
SET field = '$field'
WHERE ID = '$ID'";
$result = mysql_query($query);
Whatever you name your form element, put that variable name where $field
is... the contents of the element will be directly accessible by this
name once you POST if it is a textbox or list/menu, if you're using
radio buttons you can test what the value attribute is, and if you're
using checkboxes you can use isset() to see if it was checked.
Marcus