PHP功能不起作用:/

时间:2013-01-08 04:36:32

标签: php mysql function

function uyeyap()
{
global $veriyolu;
$idno=$_REQUEST['uyeno'];
$guncelle=mysql_query("uptade uyeler set onay='1' where uyeno='$idno'",$veriyolu);

if($guncelle){
             echo "<script>alert(' Üye Yapıldı! ')</script>";
             echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php'>";
             }else{
             echo "<script>alert(' !! Üye Yapılamadı !! ')</script>";
             echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php'>";            
             }
}

function adminyap()
{
global $veriyolu;
$idno=$_REQUEST['uyeno'];
$guncelle=mysql_query("uptade uyeler set onay='2' where uyeno='$idno'",$veriyolu);
if($guncelle){
             echo "<script>alert(' Admin Yapıldı! ')</script>";
             echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php'>";
             }else{
             echo "<script>alert(' !! Admin Yapılamadı !! ')</script>";
             echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php'>";            
             }
}

function sil()
{
$idno=$_REQUEST['uyeno'];
global $veriyolu;
$guncelle=mysql_query("delete from uyeler where uyeno='$idno'",$veriyolu);
if($guncelle){
             echo "<script>alert(' Silindi ! ')</script>";
             echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php'>";
             }else{
             echo "<script>alert(' !! Silinemedi !! ')</script>";
             echo "<meta http-equiv='Refresh' content='0; URL=yonetim.php'>";            
             }
}
<?php
$menu= $_GET['menu'];
if ($menu = 1)
{
echo "<table>";
$sql1="select * from uyeler order by onay desc";
$sorgu1=mysql_query($sql1);
while ($sql1sonuc = mysql_fetch_array($sorgu1))
{
if ($sql1sonuc["onay"]==2)
{
echo "<tr><td><font color='red'><b>Admin</b></font></td><td>&nbsp</td><td>".$sql1sonuc['kulladi']."</td><td>&nbsp</td><td>"."<a href='yonetim.php?menu=$menu&uyeno={$sql1sonuc['uyeno']}&git=uyeyap'>Üye yap</a>"."</td></tr>";
}
if ($sql1sonuc["onay"]==1)
{
echo "<tr><td><font color='blue'>Üye</font></td><td>&nbsp</td><td>".$sql1sonuc['kulladi']."</td><td>&nbsp</td><td>"."<a href='yonetim.php?menu=$menu&uyeno={$sql1sonuc['uyeno']}&git=adminyap'>Admin yap</a>"."</td></tr>";
}

}
echo "</table>";
}
?>
</div>
</body>
<?php
switch ($_GET['git']){ 
case "adminyap";
adminyap();
break;
case "uyeyap";
uyeyap();
break;
}
?>

大家好 我有个问题 :( 功能不起作用。 不要更改mysql数据。 功能有问题吗? 抱歉我是新手 我使用方法错了吗? 我怎样才能使它工作? 请求方法有误吗?

1 个答案:

答案 0 :(得分:1)

在您的查询中,您输入了uptade而不是update。请检查您的查询