Location: PHPKode > projects > PHP OpenTailorShop > phpopentailorshop/webkasse/getkunde.php
<?php

require_once("xajax/xajax.inc.php");

$xajax = new xajax();
$xajax->registerFunction("getkunde");

function getkunde($arg)
{
    // do some stuff based on $arg like query data from a database and
    // put it into a variable like $newContent
    $newContent = "Value of \$arg: ".$arg;
    
    // Instantiate the xajaxResponse object
        $objResponse = new xajaxResponse();

        $sql = "SELECT * FROM `kunden` WHERE `KundenNr`='".$arg."' LIMIT 1";
        $result = mysql_query($sql) or die( mysql_error() );
        if (mysql_num_rows($result) > 0)
        {
        	if ( $row = mysql_fetch_array($result) )
        	{
                        $objResponse->assign("firma","value",$row['Firma']);
                        $objResponse->assign("ort","value",$row['Ort']);
                        $objResponse->assign("telefon","value",$row['Telefonnummer']);
        	}
        }
        return $objResponse;
}

$xajax->processRequest();
?>
Return current item: PHP OpenTailorShop