将脚本从PHP 5.6移到PHP 7.2

时间:2019-11-04 08:26:05

标签: php mysql pdo

我在下面编写的脚本在PHP 5.6上运行良好,现在出错了。
什么是使该脚本正常工作的有效解决方案?
我无法添加任何内容。
并且主机没有响应。
我该怎么做才能运行脚本。

 <?
session_start();  include"cp_admin/config.php";
if($_SESSION['login_user']){  }else{



    $ip = $_SERVER['REMOTE_ADDR'];
    $sel_ip = $conn->query("select * from ip where ip='$ip'");
    $row_ip = $sel_ip->rowcount();
    if($row_ip >= 1){
        $ff_ip = $sel_ip->fetch();
        $_SESSION['login_user']= $ff_ip['id'];
        }else{
    $in = $conn->query("insert into ip(ip) values('$ip')");
    $id = $conn->lastInsertId();
    $_SESSION['login_user']= $id ;
            }

    }

$idd = $_SESSION['login_user'];

    $s_se = $conn->prepare("select * from ip where id=:idd ");
    $s_se->bindparam(':idd' ,$idd, PDO::PARAM_INT);
    $s_se->execute();
    $sett = $s_se->fetch();

    $time0 = time();
    $seltim = $conn->query("select * from posts_users where id_users='$idd' and time <='$time0'  ");
    while($ftime = $seltim->fetch()){
        $idid_t = $ftime['id'];
        $id_time = $conn->query("update posts_users set time='' where id='$idid_t' ");
        }


?>

0 个答案:

没有答案