Select met Aj*x met PDO

Het andere bestand is getuserpdo.php
Tabel (models.sql)


Hier komt de informatie uit de query
<html>
<head>
<script>
function showUser(str)
{
if (str=="")
  {
  document.getElementById("content").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("content").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getuserpdo.php?q="+str,true);
xmlhttp.send();
}
</script>
<style>
/* CSS code */
body

font-family: Calibri;
font-size: 18px;
color: white;
background-color: #1e2426;
}
/* hyperlink */
a:link {
color:#F5A9A9;
text-decoration: none;
}    
/* unvisited link */
a:visited 
{
color:#F5A9A9;

/* visited link */
a:hover
{
 color:#F5A9A9;
}  
/* mouse over link */
a:active 
{
color:#F5A9A9;
}  /* selected link */
</style>
</head>
<body>
<h1>Select met Aj*x met PDO</h1>
Het andere bestand is <a href="getuserpdo.php?q=1056">getuserpdo.php</a></br>
<a href="models.sql">Tabel (models.sql)</a></br></br>
<form>
<select name="users" onchange="showUser(this.value)">
<option value="">Selecteer een persoon:</option>
<option value="1002">Murphy</option>
<option value="1056">Mary</option>
<option value="1076">Jeff</option>
<option value="1216">Steve</option>
<option value="1612">Peter</option>
<option value="">Alles</option>
</select>
</form>
<br>
<div id="content"><b>Hier komt de informatie uit de query</b> </div>

</body>
</html> 

<?
error_reporting
(0);
/////////////////////// 
show_source(__FILE__);
?>