Ben bu kodu bir. Php dosyası arıyorum. Dosyası "fetchvalues.php" in, ben veritabanından sonuçlar getiriliyor ve geri çağıran JQuery işlevine sütun değerlerini dönmek ve benim sayfa HTML denetimleri görüntülemek istediğiniz duyuyorum.
Bunu nasıl?
$(document).ready(function() {
$("#Edit").click(function() {
$.get('fetchvalues.php', null, function() {
alert('reached');
});
});
});
Edited: Code: fetchvalues.php
<?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;
}
?>