You need to single quote non-numeric values in your SQL. My usual method is to use double quotes for the string, single quotes around SQL values, and break out of the string for variables. Like so:
$a = "bob";
$sql = "SELECT Name,
Email,
Company
FROM cust
WHERE Name='".$a."'";
$result = mysql_query($sql);