güncelle yaparken hata alıyorum yardım edecek var mı? .
<?php
$baglanti = mysql_connect("localhost","root","") or mysql_error();
mysql_select_db("saydam2",$baglanti) or mysql_error();
$id = @$_GET["id"];
if ($_POST) {
$mahalle =$_POST["mahalle"];
$guncelle =mysql_query(" UPDATE kiralik SET mahalle ='$mahalle', id='$id'");
if ($guncelle) {
echo "<font color='green'> Basariyla Güncellendi! </font>";
header ("Refresh:2; url=listele.php");
} else {
echo" <font color='red'> Bir Sorun olustu :(<br/> </font> ";
}
}else {
//mesaji bul
$bul =mysql_query ("select * from kiralik where id='$id'");
$goster = mysql_fetch_array($bul);
extract($goster);
echo" <form action='' method='post'>
Mahalle
<input name='mahalle' type='text' VALUE='{$mahalle}' />
<input type='submit' value='GUNCELLE' />
</form>
";
}
?>
yukarıdaki kod kısmnda
echo" <font color='red'> Bir Sorun olustu :(<br/> </font> ";
satırında hata alıyorum yardımcı olacak var mı
Php
önce şu satırın altında echo ile gelen bilgiyi yazdırın
$mahalle =$_POST["mahalle"];
sonra da mysql sorgusundan aşağıdaki satıra mysql_error(); yazıp hata varmı bakın.