User Tools

Site Tools


kurs:einfachste_form
<form name="form" 
      action="<?php $PHP_SELF; ?>"
	  method="get">  
Name:<input name="name" type="text" size="30">
<br>
<input type="submit" value="Get Info">
</form>
<?php

if ($_GET['name']) {
  $db = oci_connect('hr', 'hr', 'orcl');
  $suche = $_GET['name'];
  $q = oci_parse($db, 
  "select last_name ln, salary from employees
    where last_name = :suche");	
  oci_bind_by_name($q, ":suche", $suche);
  $r = oci_execute($q, OCI_DEFAULT);
  while ($row = oci_fetch_array($q, OCI_ASSOC)) {
    printf("%s verdient %s<br>", 
	   $row['LN'], $row['SALARY']);	   
  }  
}
kurs/einfachste_form.txt · Last modified: 2014/09/10 21:22 (external edit)