Okay, so a few things I'm going to try to quickly help you.
Query
Your request is complex, but I feel useless. I have been working with MySQL for a long time, and I canβt remember the situation when I used INNER JOIN in the method that you are. Therefore, a much shorter syntax for your query: SQL Aliases
$query = "SELECT s.*, p.Pool, p.AreaManager, e.EmployeeID, e.FirstName FROM SpringMgmt as s, Pool as P, Employees as E WHERE s.PoolID = p.PoolID AND e.EmployeeID = p.AreaManager ";
HTML
Assuming that the HTML in your script is the way you want it to display, here are a few things: you can avoid double quotes so that they don't break your code. I would modify the code inside your loop: Click here to understand the instructions for ".$variable." that I entered into your code
echo "<form id=\"myForm\" name=\"myForm\" method=\"post\">"; echo "<tr>"; echo "<td data-field-id=\"pool\">".$record['Pool']."</td>"; echo "<td ><textarea data-field-id=\"notes\" size=\"4\" name=\"Notes\" rows=\"3\" cols=\"22\">".$record['Notes']."</textarea> </td>"; echo "<td style=\"background-color:\"><input data-field-id=\"submitted\" type=\"text\" size=\"3\" name=\"SOIEstSubmitted\" value=\"".$record['SOIEstSubmitted']."\" /></td>"; echo "<td ><textarea size=\"4\" data-field-id=\"additional\" name=\"EstAdditional\" rows=3 cols=\"12\">".$record['EstAdditional']."</textarea></td>"; echo "<td style=\"background-color:\"><input data-field-id=\"meetingScheduled\" type=\"text\" size=\"3\" name=\"SOIMeetingScheduled\" value=\"".$record['SOIMeetingScheduled']."\" /></td>"; echo "<td> <input type=\"hidden\" name=\"SpringMgmtID\" value=\"$record[SpringMgmtID]\" /> <input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Submit\" /> </div></td>"; echo "</tr>"; echo "</form>";
AJAX / Javascript Calls
This is a little harder to explain. The jQuery ajax success function can take several parameters that will help you in your request. See this link for more details. Go to the section on the .done() function. One of them is the data returned from the request. This means that in your update4.php file, if you output the data to the browser as a JSON object, you can then use this data on your original page.
$(document).ready(function(){ $('form').on('submit', function (e) { e.preventDefault(); $.ajax({ type: 'post', url: 'update4.php', data: $(this).serialize(), success: function (data,successText) { for(var x in data){
});
Update4.php
As another user pointed out in the comments section, your query is very dependent on SQL Injection. Please follow the link they provided to find out more.
Now, if you want all the data to go back, the last set of lines in the update4.php file should be close to:
<?php require_once 'header.php'; if (!$loggedin) die(); if(isset($_POST['submit'])){ $UpdateQuery = $result = mysql_query($UpdateQuery); if($result!==false){ echo json_encode(array( 'notes'=> $_POST['Notes'], 'submitted'=> $_POST['SOIEstSubmitted'], 'additional'=>$_POST['EstAdditional'], 'meetingScheduled'=>$_POST['SOIMeetingScheduled'] )); } };
NOTE I do NOT recommend doing this. You must move these $_POST variables to other variables that you properly sanitized. NEVER assume that your users do not know web technologies. Always, ALWAYS assume that the user is the one who has the malicious intent to steal data from your database. Therefore, ALWAYS check the data entered by the user. The only reason I put this is because you seem to be completely new to these aspects of web development and with all the other information that I presented, I don't want to overload you and disconnect you from web development / design .
Side note
I would suggest looking for a template mechanism of some variety. Generally, it is best to use your display (HTML) and data (PHP) as separately as possible. The only template mechanisms I used earlier were a modified version of the template engine PhpBB 3 and Smarty (on which the phpBB team based its template engine).
From the beginning of entering this text, I saw another answer and quickly read it. I think we both look at slightly different parts of your common problem, so I will give you this entry as a reference, although I think the other user answer is slightly better than mine. I repeat his mood, although if I sound condescending or angry, I do not want to do this.
Also, since I'm sure someone pointed out or told you to get used to using mysqli_ * functions, since mysql_ will be deprecated (no longer in use) in future versions of PHP.