这是我的功能代码
function icerikduzenle($a,$b,$c)
{
global $veriyolu;
$menuid=$c;
$icerik=$b;
$icerik_id=$a;
$guncelle=mysql_query("update icerik set icerik='$icerik' , menu_id='$menu_id' where icerik_id='$icerik_id'",$veriyolu);
if($guncelle){
echo "<script>alert(' İçerik düzenlendi! ')</script>";
echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php?menu=2'>";
}else{
echo "<script>alert(' !! İçerik düzenlenemedi !! ')</script>";
echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php?menu=2'>";
}
}
我认为我对 _post vars 有问题。列出没有错误但不更新数据的数据
这是主要代码我不喜欢mysql中的连接表我使用了2个sql我认为post vars不会去任何地方
$iceriksql="select * from icerik order by menu_id asc";
$iceriksorgu= mysql_query($iceriksql);
echo "<table>";
while($iceriksonuc=mysql_fetch_array($iceriksorgu))
{
echo "<form method='post' action='yonetim.php?menu=2&icerikid={$iceriksonuc["icerik_id"]}&git=icerikduzenle'>";
$menusql= "select * from menu order by menu_id asc";
$menusorgu = mysql_query($menusql);
echo "<tr><td><select name='menu_id'>";
while ($menusonuc=mysql_fetch_array($menusorgu))
{
if ($menusonuc['menu_id']==$iceriksonuc['menu_id'])
{
echo "<option value='{$menusonuc["menu_id"]}' selected>{$menusonuc["menu"]}</option>";
}
else
{
echo "<option value='{$menusonuc["menu_id"]}'>{$menusonuc["menu"]}</option>";
}
}
echo "</select></td>";
echo "<td><textarea name='icerik'>{$iceriksonuc["icerik"]}</textarea></td><td><input type='submit' name='submit' value='Düzenle' /></td></tr>";
echo "</form>";
}
echo "</table>";
这是我的代码的最后一部分
switch ($_GET['git']){
case "icerikduzenle";
icerikduzenle($_REQUEST['icerik_id'],$_REQUEST['icerik'],$_REQUEST['menu_id']);
break;
}