第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

盡管 MySQL 數(shù)據(jù)庫中有數(shù)據(jù),但圖像不顯示

盡管 MySQL 數(shù)據(jù)庫中有數(shù)據(jù),但圖像不顯示

PHP
繁星點點滴滴 2022-06-11 10:32:28
目前,我的項目有問題。photo before在 MySQL 數(shù)據(jù)庫中,有兩個名為photo_afterBLOB的列。base64在將圖像顯示到 PHP 頁面時,我使用它來解碼圖像。主要問題是列中是否有數(shù)據(jù)photo_before或者photo_after它仍然顯示' noimage.jpg '。我不知道為什么。下面是我的代碼:<?php$report_id = $_GET['report_id'];$sql = "SELECT * FROM report LEFT JOIN users ON report.badgeid = users.badgeid LEFT JOIN team ON team.team_id = users.team_id WHERE report_id = :report_id";$query = $conn->prepare($sql);$query->execute(array(':report_id' => $report_id));while($row = $query->fetch(PDO::FETCH_ASSOC)){    $report_id = $row["report_id"];    $report_date = $row["report_date"];    $task_name = $row["task_name"];    $photo_before = $row["photo_before"];    $photo_after = $row["photo_after"];    $ot_start = $row["ot_start"];    $ot_end = $row["ot_end"];    $time_photo_before = $row["time_photo_before"];    $time_photo_after = $row["time_photo_after"];    $report_status = $row["report_status"];}?><tr>  <td rowspan = '2'><b>Before Task</b></td>  <?php    if(!isset($row['photo_before']) || empty($row['photo_before'])) {        echo "<td colspan='3'><img src='../../images/faces/noimage.png'/></td>";      }else{               echo "<td colspan='3'><img src='data:image/jpeg;base64,".$row['photo_before']."'/></td>";       }  ?></tr><tr>  <td colspan='3'><?php echo "Time: <b>" .$time_photo_before."</b>"; ?></td></tr><tr>  <td rowspan = '2'><b>After Task</b></td>  <?php    if(!isset($row['photo_after']) || empty($row['photo_after'])) {        echo "<td colspan='3'><img src='../../images/faces/noimage.png'/></td>";      }else{               echo "<td colspan='3'><img src='data:image/jpeg;base64,".$row['photo_after']."'/></td>";       }  ?></tr>
查看完整描述

2 回答

?
qq_笑_17

TA貢獻1818條經(jīng)驗 獲得超7個贊

empty() 函數(shù)返回 true 或 false 當變量數(shù)據(jù)存在并且具有非空、非零值時,它返回 FALSE。否則返回 TRUE。添加并嘗試,希望它會工作:

if(!isset($row['photo_after']) || empty($row['photo_after'])== 'true/false')


查看完整回答
反對 回復(fù) 2022-06-11
?
開心每一天1111

TA貢獻1836條經(jīng)驗 獲得超13個贊

似乎問題出在 Your 上if( the problem is here ),|| / 或邏輯發(fā)送真如果 0|1,1|0 和 1|1...檢查你的 php 版本,".$row['photo_before']."你的 " 使用 " 或 ',我的使用'.$row['photo_before'].'



查看完整回答
反對 回復(fù) 2022-06-11
  • 2 回答
  • 0 關(guān)注
  • 300 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號