Hi,
I am using jquery ajax with PHP and I would like to return individual rows instead of html. here is my code:
$('#btnShowDetails').click(function(){
$.ajax({
url : "get_company_details.php",
data : 'id=ed23e767-539f-11e3-aef0-74de2b9a31a4',
type : "post",
success : function(data)
{
$('#lblCompanyName').text(company name from data result);
$('#lblCompanyWebsite').text(company website from data result);
}
});
});
and here is my get_company_details.php:
<?php
include('../includes/php_header.php');
include($_SESSION["absolute_path"] . '/includes/connect2db.php');
if (!isset($_SESSION["member_loggedOn"])) { exit(header("Location: ../signin")); }
$mysql_query = $mysql_connection->prepare("CALL sp_get_company_details(:param_company_guid)");
$mysql_query->bindParam(':param_company_guid', $_GET["id"], PDO::PARAM_STR);
$mysql_query->execute();
$mysql_row_count = $mysql_query->rowCount();
if ($mysql_row_count <= 0) { exit(header("Location: " . $_SESSION["domain_name"] . "home")); }
while ($mysql_row = $mysql_query->fetch())
{
$company_id = $mysql_row["company_id"];
$company_guid = $mysql_row["company_guid"];
$company_name = $mysql_row["company_name"];
$company_industry = $mysql_row["industry_name"];
$company_country = $mysql_row["country_name"];
$company_region = $mysql_row["region_name"];
$company_telephone = $mysql_row["company_telephone"];
$company_fax = $mysql_row["company_fax"];
$company_website = $mysql_row["company_website"];
$company_email = $mysql_row["company_email"];
$about_company = $mysql_row["about_company"];
$hide_email = $mysql_row["hide_email"];
}
?>
Thanks,
<snip/>