Get values of called file
<p>I am calling a .php file in this code. In the file "fetchvalues.php", I am fetching results from the database and want to return the column values back to the calling JQuery function and display them on HTML controls of my page.</p>

<p>How to do so?</p>

<pre><code>$(document).ready(function() {
    $("#Edit").click(function() {
        $.get('fetchvalues.php', null, function() {
            alert('reached'); 
        });
    });
});
</code></pre>

<p><strong>Edited:</strong> 
Code: fetchvalues.php</p>

<pre><code>&lt;?PHP

 //Get selected row's RecordID column value
 $SelectedRowID = $_GET['UpdateRecordID'];
 //Open Connection
 $connection = mysql_connect("localhost:3306", "abcd", "abcd");
 mysql_select_db("pglobal", $connection);

 //Prepare query to retrieve results
 $FetchResultsQuery = "SELECT * FROM listing WHERE recordid=" . $SelectedRowID;

 try
 {
  $result = mysql_query($FetchResultsQuery);
  $row = mysql_fetch_row($result);
  if ($row)
  {
   $PostedDate = date('d.M.Y', strtotime($row[0]));
   $Places =  html_entity_decode($row[1]);
   $Company = html_entity_decode($row[2]);
   $Designation = html_entity_decode($row[3]);
   $ProjectDetails = html_entity_decode($row[4]);
   $DesiredCandidate = html_entity_decode($row[5]);
   $HRName = html_entity_decode($row[6]);
   $HRContact = html_entity_decode($row[7]);
   $Email = html_entity_decode($row[8]);

   $_SESSION['WorkMode'] = 'Edit';
   $_SESSION['DataToBeEdited'] = $PostedDate .'+'. $Places .'+'. $Company .'+'. $Designation .'+'. $ProjectDetails .'+'. $DesiredCandidate .'+'. $HRName .'+'. $HRContact .'+'. $Email;
  }
  else
  {
   $_SESSION['DataToBeEdited'] = "";
   return;
  }

 }
 catch(exception $err)
 {
  echo $err;
 }
?&gt;
</code></pre>
