<?php

include("kurs/datenbankanbindung.php");     // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
$db = dbconnect();

header("Content-Type: text/html;charset=utf-8");

if(isset($_GET['getWord']) && isset($_GET['letters'])){
	$letters = $_GET['letters'];
	#$letters = preg_replace("/[^a-z0-9 ]/si","",$letters);
	$res = $db->query("select uid, vorname, nachname, mtknr from stud WHERE (nachname like '%".$letters."%' OR mtknr like '%".$letters."%' or vorname like '%".$letters."%' or uid like '%".$letters."%') ORDER BY nachname") or die(mysql_error());
	#echo "1###select ID,textstelle Name from ajax_countries where textstelleName like '".$letters."%'|";
	while($inf = $res->fetch_array()){
	$name= "$inf[vorname] $inf[nachname] ($inf[mtknr],$inf[uid])";
		echo $name."|";
	}	
}
?>
