Why isn't this working? PHP/MYSQL

can someone explain to me why this isn’t working?? I’m getting “record updated/edited!” but when i check my database, the info isn’t there. Anyone know whats goin on here??

<?php
$db = mysql_connect('localhost', 'townfre_clients','password');
mysql_select_db('townfre_connecticut',$db);
$sql = "INSERT INTO 'wallingford' (name,address,phone,category,link,renew,email,short) VALUES('$name','$address','$phone','$category','$link','$renew','$email','$short')";
// run SQL against the DB
$result = mysql_query($sql);
echo "Record updated/edited!<p>";
?>
<?
$dbh= mysql_connect ("localhost", "townfre_clients", "password") or die ('I cannot connect to the database');
mysql_select_db ("townfre_$state",$dbh); 
$table_name = $town;
$query = "select * from $table_name WHERE category = $category";
$result = mysql_query($query, $dbh) or die("Could not complete database query");
$num = mysql_num_rows($result);
if ($num != 0) {
$file= fopen("$state/$town+$category.xml", "a+");
$_xml = "<clients>
";
while ($row = mysql_fetch_array($result)) {
if ($row["name"]) {
$_xml .= "<clients name=\"" . $row["name"] . "\" address=\"" . $row["address"] . "\" phone=\"" . $row["phone"] . "\" link=\"" . $row["link"] . "\" short=\"" . $row["short"] . "\" >
";
}
}
}
$_xml .="</clients>";
fwrite($file, $_xml);
fclose($file);
?>

Thanks,
Mat