php mysql编码问题

时间:2015-03-25 03:04:25

标签: php mysql

我正在尝试匹配表1中的id,如果它存在于表2中,如果表2中存在id,则重定向一些,一旦完成,我试图匹配表1的id,表2中存在如果表2具有主要ID重定向某些其他地方重定向某些

以下是代码 任何人都可以帮助我吗?

<?php
include "../config/config.php";
$uid=$_GET['id'];

                            $sql2="SELECT id,uid FROM don_fee_student";
                            $result2=mysql_query($sql2);
                            $count2=mysql_num_rows($result2);

                            if($count2>0){

                                while ($row2=mysql_fetch_array($result2)) {

                                    $id = $row2['uid'];
                                    $aid=$row2['id'];

                                }
                                }else{
                                    echo "No Records found";
                                }

if ($uid==$id) {
    header("location:../college_fees_request.php?id=".$uid);
}
if (($uid==$id)&&(!empty($aid))) {

       header("location:../col_fees_al_req.php?id=".$uid);   
}
if (($uid==$id)&&(empty($aid))) {
 header("location:../add_don_app.php?id=".$uid);   
}
?>

当我要写这个而不是上面的if语句时,它可以工作..但我还需要检查表2是否有用户ID和应用程序ID,它需要重写到某些地方

if ($uid==$id) {
    header("location:../college_fees_request.php?id=".$uid);

}
else 
{
 header("location:../add_don_app.php?id=".$uid);   
}

0 个答案:

没有答案