nothing obvious but try connecting a different way and some error reporting
also the where statment doesnt need to be all fields just enough to make it unique
$from="ab";
$to="cd";
$Link = mysql_connect ($Host, $User, $Password) or die(mysql_error());
mysql_select_db($DBName) or die(mysql_error());
$query1="SELECT telno,fname,lname,address FROM $TableName ORDER BY telno";
$sql1=mysql_query ($query1, $Link);
while($row1=mysql_fetch_row($sql1))
{
mysql_query("UPDATE $TableName SET
telno=REPLACE(telno,'".$from."','".$to."'),
fname=REPLACE(fname,'".$from."','".$to."'),
lname=REPLACE(lname,'".$from."','".$to."'),
address=REPLACE(address,'".$from."','".$to."')
WHERE telno ='".$row1[0]."' and fname ='".$row1[1]."'");
}
but i just tested and you can do an update on whole table with just the update query so no need to even do a loop or the initail query to the database
$from="ab";
$to="cd";
$Link = mysql_connect ($Host, $User, $Password) or die(mysql_error());
mysql_select_db($DBName) or die(mysql_error());
mysql_query("UPDATE $TableName SET
state=REPLACE(state,'".$from."','".$to."'),
city=REPLACE(city,'".$from."','".$to."')
");