窗体不发送值或PHP代码不更新

时间:2013-10-02 11:03:11

标签: php

FORM

<form method="post" action="menu_duzenle_islem.php">
Şuanki İsim : <input name="menu_isim" value="<?php echo $_POST['menu_isim'] ?>"readonly>
Yeni İsim : <input name="yeni_menu_isim" placeholder="isim giriniz.">
Şuanki URL : <input name="menu_url" value="<?php echo $_POST['menu_url'] ?>"readonly>
Yeni URL : <input name="yeni_menu_url" placeholder="url giriniz">
<input type="submit" value="Düzenle">
</form>

menu_duzenle_islem.php

<?php
$con=mysqli_connect("localhost","root","","mmogezgini");
mysqli_query($con,"UPDATE menuler SET isim='$_POST[yeni_menu_isim]' and url='$_POST[yeni_menu_url]'
WHERE isim='$_POST[menu_isim]' AND url='$_POST[menu_url]'");
mysqli_close($con);
Header("Location:menuler.php");
?>

当我更新“menu_isim”和“menu_url”menu_isim显示“0”且menu_url没有改变时。

1 个答案:

答案 0 :(得分:2)

您的SQL查询不正确,请参阅以下内容:

mysqli_query($con,"UPDATE menuler SET isim='". $_POST['yeni_menu_isim']."' ,url='".$_POST['yeni_menu_url'] ."'
WHERE isim='".$_POST['menu_isim']."' AND url='".$_POST['menu_url']."'");