<?php
 include("../include/session.php");
 $table_name = $_SESSION['db_prefix']."_customer";
 $q=$_GET['q'];
 $my_data=mysql_real_escape_string($q);
 //$mysqli=mysqli_connect('localhost','username','password','databasename') or die("Database Error");
 $query="SELECT cust_id, comp_name, name_2 FROM $table_name WHERE comp_name LIKE '%$my_data%' ORDER BY comp_name";
 $result = mySQL_query($query) or die ("Error in query:   $query . * ". mySQL_error());
 if($result)
 {
  while($row=mysql_fetch_array($result))
  {
   echo $row ['cust_id']." ".$row ['name_2']." ". $row['comp_name']."\n";
  }
 }
?>
