if(!$sonuc){
mysql_query("insert into () values()");

}

bu kod çalışmıyor zaten hocam neden dersen update te veri yoksa dahi true döndüyor. hatasız işlem aldığı için