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
History of appointments
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: History of appointments
Make an `appointments` table and save them there every time. I wouldn't even use the `Next_Appointment` field in the `users` table:
appointments
appointments
Code: Select all
id user_id datemysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.