configure('javascript URI', '/');
function getemp($name) {
$db = oci_connect('hr', 'hr', 'orcl');
$sql = sprintf(
"select first_name, last_name, salary from employees where
last_name like '%s%%'",
$name);
$q = oci_parse($db, $sql);
$r = oci_execute($q, OCI_DEFAULT);
while($table = oci_fetch_array($q, OCI_ASSOC+OCI_RETURN_NULLS)) {
$row = implode($table, ' ');
$result .= $row ."
";
}
$objResponse = new xajaxResponse();
$objResponse->assign('emp_list', 'innerHTML', $result);
return $objResponse;
}
$req_get_emp =& $xajax->registerFunction('getemp');
$req_get_emp->setParameter(0, XAJAX_INPUT_VALUE, 'empname');
$xajax->processRequest();
?>
Get Employee
printJavascript();
?>
H2 {color:blue}
#emp_list {color:green}
#u1 {with:350px; float:left}
#u2 {with:350px; float:left}
#u3 {with:350px; float:right}