Hello,
I need extensive help yet again, and since you people seem to know what you’re doing I am relying on your expertise.
I have a form; this form (form2) is on the bottom of a page that displays the results from another form (form1). The results from form1 show me in information in the database including the record number. Form 2 is suppose to allow me to enter in the record number of any particular row and insert a date from the second and last field in the form.
For example if the record ID I enter is 15 and the date is 04/11/2005 I would like to enter this information into the form have a query see the record ID I have entered, find it in the database and insert the date into the database field Date_Sent.
The problem I am having is the forms and search results query’s are working find but the database is not being updated with the date from form 2, Please help and idiot find his way.
Form 2
<form method="POST" action="search_results.php" name="search_results">
<table width="69%" align="center" border="0" cellspacing="4">
<tr>
<td width="26%"><div align="right">Update Record Number </div></td>
<td width="30%">
<div align="center">
<input type="text" name="ID">
</div></td>
<td width="15%"><div align="right">With Date </div></td>
<td width="29%"><div align="center"><input id="demo1" type="text" size="25"><a href="javascript:NewCal('demo1','mmmddyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
</div></td>
</tr>
</table>
<br>
<div align="center">
<input type="submit" value="Update the database" name="search">
</div>
</form>
<?php
if (isset($_POST['Submit'])) {
include('mysql_connect_register.php');
$sql = "select * from accounts where ID = {$_POST['ID']}";
$result = mysql_query($sql);
$sql_update = "insert into accounts where ID = {$_POST['ID']}, Date_Sent Values ('{$_POST['demo1']}')";
$query_run;
}
?>