mustafa90 adlı üyeden alıntı: mesajı görüntüle
Birşey anlayamadım . Biraz daha açıklayabilirmisiniz.
ben şöyle bişi yaptım

<?php
session_start();
// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
  $MM_dupKeyRedirect="yorum_fail.php";
  $loginUsername = $_POST['soz'];
  $LoginRS__query = "SELECT yorum FROM gelenyorum WHERE yorum='" . $loginUsername . "'";
  mysql_select_db($database_lyrics, $lyrics);
  $LoginRS=mysql_query($LoginRS__query, $lyrics) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);


  //if there is a row in the database, the username was found - can not add the requested username
  if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
    header ("Location: $MM_dupKeyRedirect");
    exit;
  }
}
$formhatasi = "
<script language=\"javascript\">
this.location = \"ekle.php?hata=form\";
</script>
";
$ip = $_SERVER["REMOTE_ADDR"];
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}


$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "yorumekle")) {
  $insertSQL = sprintf("INSERT INTO eklenenler (isim, konu, mail, yorum, ip) VALUES (%s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['isim'], "text"),
                       GetSQLValueString($_POST['konu'], "text"),
                       GetSQLValueString($_POST['mail'], "text"),
                       GetSQLValueString($_POST['yorum'], "text"),
                       GetSQLValueString($ip, "text"));


  mysql_select_db($database_lyrics, $lyrics);
  $Result1 = mysql_query($insertSQL, $lyrics) or die($formhatasi);


  $insertGoTo = "yorum_ok.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
} else { ?>

<?php
}
$textstr = '';
for ($i = 0, $length = 8; $i < $length; $i++) {
   $textstr .= $chars[rand(0, count($chars) - 1)];
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "yorumekleadm")) {
  $insertSQL = sprintf("INSERT INTO yorum (isim, konu, mail, yorum) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['isim'], "text"),
                       GetSQLValueString($_POST['konu'], "text"),
                       GetSQLValueString($_POST['mail'], "text"),
                       GetSQLValueString($_POST['yorum'], "text"));
  mysql_select_db($database_lyrics, $lyrics);
  $Result1 = mysql_query($insertSQL, $lyrics) or die($formhatasi);


  $insertGoTo = "yorum_ok_adm.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
önce gelenyorum tablosuna gidiyor ordan ben onay verişyorum yorum ekleniyor fakat şurda bişi takılıo kafama bu nasıl şarkıyla aynı id yi alcak yorumlar ? yada bu kod doğrumu şuan ?