使用MySQLi从数据库中调用一行不会出现

时间:2017-09-13 02:57:10

标签: php mysqli

我在这里有一个新手,需要你的帮助...我想连续拨打电话,我使用此代码

    $myQry=$db->prepare("SELECT * FROM student ");
         $myQry->execute();
         $x = 1;
         while ($row = $myQry->fetch_assoc()) {
         $active = '';
         if($row['active'] == 1) {
          $active = '<label class="label label-success">Active</label>';
        } else {
            $active = '<label class="label label-danger">Deactive</label>'; 
        }
$output['data'][] = array(
        $row['student_code'],
        $row['student_name'],
        $row['grade_join'],
        $row['reg_date'],
        $row['email'],
        $row['phone'],
        $active
    );
$output['data'][] = array(
    $row['student_code'],
    $row['student_name'],
    $row['grade_join'],
    $row['reg_date'],
    $row['email'],
    $row['phone'],
    $active
);

数据没有出现。我做错了什么?

0 个答案:

没有答案