I'm doing a website for my senior project class at my college based off of my job at a small local computer shop. I have most of the parts working at this point except for one. I have a page that lists all of the active repairs with an update button next to each one. When I click the update button, the repair page comes up with various attributes about the repair, and those attributes are already filled into their respected input fields.
The last thing I'm trying to accomplish is when I insert the "repairNotes" into the database (which I do have working), when I bring the page back with the rest of the details, I want the repair notes there as well so that technicians can continuously add to them.
Here's some example code for when I get fields from the database and populate the text fields:
$query = "SELECT date, make, model
FROM repair
JOIN customer on customer.custID = repair.customerID
WHERE repairID = '$repairID'";
$result = mysqli_query($mysqli, $query);
if($result){
list($datOfRepair, $make, $model) = mysqli_fetch_row($result);
}
In my HTML I have
<p align=\"left\"> Date: <input type=\"text\" name=\"date\" value = \"$datOfRepair\" size=\"6\" readonly = 'true'> </p>
<p align=\"left\">Make: <input type=\"text\" name=\"make\" value = \"$make\" size=\"10\" readonly = 'true'></p>
<p align=\"left\"> Model: <input type=\"text\" name=\"model\" value = \"$model\" size=\"10\" readonly = 'true'></p>"
For adding the repair notes, I have
$query = "UPDATE repair SET
repairNotes = '$repairNotes'
WHERE repairID = '$repairID'";
$result = $mysqli->query($query);
if ($result) {$msg = "Repair Notes added to database"; }
<textarea name=\"repairNotes\" style=\"width:650px; height:200px;\">$repairNotes</textarea><br>
How can I get the repairNotes code to still input to the database, but when I load the repair page by clicking on the "update" button on the list of repairs act like the first part of my code? Do I need to have a variable that concatenates the the current repairNotes with the newly added repair notes?
Sorry for the long post, I had to explain everything.