How to return a individual rows using ajax

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/>

Whatever the PHP echos is what is going to get returned. If you want one row returned from each call to the server then you will need to restructure the PHP so that it echos one row each time it is called. So the while loop will go and the query will need to be changed to get the next row satisfying the condition rather than all of the rows.

How? do you a sample?