<?php
// gets select of customers in json for autocomplete
include 'includes/database.php';
$db=new MySQLDatabase();
$db->open_connection();
$cuslist = '';
$sql = mysqli_query($db->connection, "SELECT DISTINCT cname FROM customers ORDER BY cname") or die (mysqli_error($db->connection) );
while ($row = mysqli_fetch_array($sql, MYSQLI_ASSOC)){
    $cuslist = $cuslist. '<option value="'.$row['cname'].'" >'.$row['cname'].'</option>';
    }
echo $cuslist;	
$db->close_connection();

?>