$sql = mysql_query("select * from nom_table where Nom like '%*' and Nom not like '%**'");
while($tab=mysql_fetch_array($sql)){
$id=$tab["id"];
$nom=$tab["nom"];
$n_nom = substr($nom,0,strlen($nom)-1);
$sql2 = mysql_query("update nom_table set Nom='".$n_nom ."' where id='".$id ."'");
}