Bu formun amacı değer tabloda, sütun içinde bir bilgi verilmişse göstermek eğer verilmemişse veri boş döner, eğer update yaparsanız belirtilen tablodaki sütunları update eder. Bir WHERE komutu vermediğiniz için (id vs.) bende gerek duymadım, sadece tablonun içindeki sütun sayısının 1 olduğunu farz ediyorum. (Row). Umarım yardımı olmuştur.
<!-- sütun adları: title,favicon,key tablo adı: admin-->
<?php
include 'config.php';
$query = "SELECT title,favicon,key FROM admin"
$check = mysql_query($query);
$fetch = mysql_fetch_object($check);
echo'<form class="stdform stdform2" method="post" action="">
<p>
<label>Title</label>
<span class="field"><input type="text" name="input5" class="input-xxlarge" placeholder="'.$fetch->title.'"></span>
</p>
<p>
<label>Favicon</label>
<span class="field"><input type="text" name="input5" class="input-xxlarge" placeholder="'.$fetch->favicon.'"></span>
</p>
<p>
<label>Keyi</label>
<span class="field"><input type="text" name="input5" class="input-xxlarge" placeholder="'.$fetch->key.'" ?>"></span>
</p>
<p class="stdformbutton">
<input type="submit" class="btn btn-primary" name="change" value="Değiştir." />
<button type="reset" class="btn">Sıfırla</button>
</p>
</form>';
if(isset($_POST["change"]) && $_POST["change"] == "Değiştir.")
{
$title = mysql_real_escape_string(htmlspecialchars($_POST["item_price"], ENT_QUOTES));
$favicon= mysql_real_escape_string(htmlspecialchars($_POST["item_descr"], ENT_QUOTES));
$key = mysql_real_escape_string(htmlspecialchars($_POST['char'], ENT_QUOTES));
$update = mysql_query("UPDATE admin SET title = '".$title."', favicon = '".$favicon."', '".$key."'");
if ($update)
{
echo'<p>Başarılı.</p>';
}
else
{
echo'<p>Başarısız, yöneticiyle görüşünüz.</p>';
}
}
?>