History of appointments
Posted: Thu Mar 11, 2010 3:21 pm
I have searched this forum and googled this, but as I'm unsure what to search for so I now post my requirement here with the hope that one of you more PHP/MYSQL experienced persons can assist.
I have a PHP form that contains an input name='Next_Appointment' which gets updated by clicking on the calendar popup (.js) my requirement is to be able to save the previous appointments thus creating a history of appointments in the DB or where ever the best place is to do this.
The MYSQL db uses the following to update the 'Next_Appointment' field in the database.
mysql_query("UPDATE users SET
......, other fields SET OK
......,
'Next_Appointment` = '$data[Next_Appointment]',
...... a few more fields
WHERE id='$_SESSION[user_id]'
") or die(mysql_error());
$msg = urlencode("Execise log Successfully saved");
header("Location: client.html?msg=$msg");
The FORM is coded this way;
<tr>
<td><span class="style20b">Next Appointment Date:</span></td>
<!-- <td><input name="Next_Appointment" type="text" value="<? // echo $row_settings['Next_Appointment']; ?>"> -->
<td><input name="Next_Appointment" id="Next_Appointment" type="text" value="<? echo $row_settings['Next_Appointment']; ?>" size="25"><a href="javascript:NewCal('Next_Appointment','ddmmyyyy',true,24)"><img src="js/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
</tr>
So in summary -
The coding as is, updates (SETs) the Next_Appointment OK, all I need now is some way of storing the current Next_Appointment value to create the appointment history. I'm completely lost here on how to achieve this and open to suggestions on the best way to do it.
Many Thanks in advance
I have a PHP form that contains an input name='Next_Appointment' which gets updated by clicking on the calendar popup (.js) my requirement is to be able to save the previous appointments thus creating a history of appointments in the DB or where ever the best place is to do this.
The MYSQL db uses the following to update the 'Next_Appointment' field in the database.
mysql_query("UPDATE users SET
......, other fields SET OK
......,
'Next_Appointment` = '$data[Next_Appointment]',
...... a few more fields
WHERE id='$_SESSION[user_id]'
") or die(mysql_error());
$msg = urlencode("Execise log Successfully saved");
header("Location: client.html?msg=$msg");
The FORM is coded this way;
<tr>
<td><span class="style20b">Next Appointment Date:</span></td>
<!-- <td><input name="Next_Appointment" type="text" value="<? // echo $row_settings['Next_Appointment']; ?>"> -->
<td><input name="Next_Appointment" id="Next_Appointment" type="text" value="<? echo $row_settings['Next_Appointment']; ?>" size="25"><a href="javascript:NewCal('Next_Appointment','ddmmyyyy',true,24)"><img src="js/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
</tr>
So in summary -
The coding as is, updates (SETs) the Next_Appointment OK, all I need now is some way of storing the current Next_Appointment value to create the appointment history. I'm completely lost here on how to achieve this and open to suggestions on the best way to do it.
Many Thanks in advance