警告:非法字符串偏移量'Student_ID'HostGator

时间:2019-11-22 10:59:27

标签: php mysqli

  

警告:字符串偏移量'Student_ID'在   /home/myuser/public_html/SSD_define.php,第21行

     

警告:字符串偏移量'Student_ID'在   /home/myuser/public_html/SSD_define.php,第22行

     

警告:字符串偏移量'Student_ID'在   /home/myuser/public_html/SSD_define.php,第32行

我的代码在HostGator上不起作用,请在上面获取此错误。  但是在我的本地主机上就可以了

$connection = mysqli_connect($db_host, $db_username, $db_password, $Database);
$SSD_sql = $connection->query("SELECT * from Examdata join (SELECT Student_ID, count(*), exam_dates FROM Examdata 
group by Student_ID, exam_dates
having count(*) > 1) Examdata1 on Examdata.Student_ID=Examdata1.Student_ID 
and Examdata1.exam_dates=Examdata.exam_dates 
order by Examdata1.Student_ID,Examdata1.exam_dates ;")->fetch_assoc();
$student = "";
// if (is_array($SSD_sql)) {
foreach ($SSD_sql as $sq) {
    if ( $student != $sq["Student_ID"]) {
        $student = $sq["Student_ID"];
        echo '<table id="ssd_student"  class="panel"> 
        <tr>
        <td width="70px">
        <label>
            <input type="submit" class="' . $student . '" onclick="Function();" id="SSD-detiles">
            <img src="images/up-arrow.png"id="img_arrow">
            <br>
        </label>
        </td>';
        echo '<td> Student ID: ' . $sq["Student_ID"] . '</td></tr>';
    }
           // إظهار التفاصيل لكل طالب 
    echo '<tr id="ssd_data" class="'. $student . '" >';
    echo '<td class="myDIV">' . $sq["Class_ID"] . '</td>';
    echo '<td class="myDIV">' . $sq["Subject_ID"] . '</td>';
    echo '<td class="myDIV">' . $sq["Subject_name"] . '</td>';
    echo '<td class="myDIV">' . $sq["lecturer_name"] . '</td>';
    echo '<td class="myDIV">' . $sq["exam_days"] . '</td>';
    echo '<td class="myDIV">' . $sq["exam_dates"] . '</td>';
    echo '<td class="myDIV">' . $sq["exam_times"] . '</td></tr>';
}
// }
?>
</table>

0 个答案:

没有答案