<?php
 include("../include/session.php");
 //echo "it comes to it";
 $q=$_GET['q'];
 $my_data=mysql_real_escape_string($q);
 //$mysqli=mysqli_connect('localhost','username','password','databasename') or die("Database Error");
 $query="SELECT DISTINCT orderNo FROM nam_orders WHERE orderNo LIKE '%$my_data%' AND reserved<>0 ORDER BY orderNo";
 $result = mySQL_query($query) or die ("Error in query:   $query . * ". mySQL_error());
 if($result)
 {
  while($row=mysql_fetch_array($result))
  {
   echo $row['orderNo']."\n";
  }
 }
?>
