Never use customerName as a key, what if you have 2 John Smiths? Each record should have a unique primary key (autonumber, hash, whatever) but it needs to be unique so that you don't kill incorrect records.
That said, a simple way to test your sql is to echo it out onto the page and then copy it to phpmyadmin or another gui db tool. I think in this case, you will have a funky sql because of the post and the customerName variable
Code:
if ((!empty($_POST['CustomerName']))&&($_POST['CustomerName'] != 'all'))
{
$sql .= " WHERE CustomerName LIKE '". addslashes($_POST['CustomerName'])."' ";
}
would be more like what you need
_________________
Lostboy
Cat, the other other white meat
Please read
Posting Etiquette before posting
You can always try
Google