可以获取编辑部分的数据<br/> <b>注意</b>:未定义的变量:行

时间:2017-10-08 15:52:04

标签: php html

我是PHP新手。我继续得到“未定义的变量行”。我已经阅读并尝试了其他相关问题和答案的建议,但没有任何对我有用。

PHP代码

Unknown configuration setting

在我的HTML代码上继续收到此行的错误:

 <?php
 session_start();
 require_once('dbConfig.php');
if(isset($_GET['ass_id'])){
    $ass_id = $_GET['ass_id'];
    $sql = "select * from beedass where ass_id=".$ass_id;
    $result = mysqli_query($conn, $sql);
    if(mysqli_num_rows($result) > 0){
        $row = mysqli_fetch_assoc($result);
    }else{
        $errorMsg = 'Could not select a record';
    }
}
if(isset($_POST['btnUpdate'])){
    $subject = $_POST['subject'];
    $date = $_POST['date'];
    $content = $_POST['content'];


    if(empty($subject)){
        $errorMsg = 'Please input subject course';
    }elseif(empty($date)){
        $errorMsg = 'Please input date to be passed';
    }elseif(empty($content)){
        $errorMsg = 'Please input assignment content';
    }


    //check upload file not error than insert data to database
    if(!isset($errorMsg)){
        $sql = "update beedass
                                set subject = '".$subejct."',
                                    date = '".$date."',
                                    content = '".$content."'
                where ass_id=".$ass_id;
        $result = mysqli_query($conn, $sql);
        if($result){
            $successMsg = 'New record updated successfully';
            header('refresh:5;view_beedass.php');
        }else{
            $errorMsg = 'Error '.mysqli_error($conn);
        }
    }

  }
 ?>

我得到的错误是echo $ row ['subject']中的未定义变量行,echo $ row ['date']和echo $ row ['content']。

0 个答案:

没有答案