0
如何在此代碼中設置顯示類似「目前沒有發佈內容,請稍後再回來查看」的條件。如果沒有任何檢索或輸入?目前,如果沒有檢索到或輸入任何內容,它只在前端顯示任何內容。因此,我想代之以放棄一切信息。How to say如果沒有檢索到或已輸入數據,請執行此操作
if($seasontype=="pending"){
$result = " SELECT * FROM ".$wpdb->prefix."bidsys_picklist WHERE sport = ".$sport." AND pick_result='PENDING' ORDER BY game_date DESC";
$newmeta = $wpdb->get_results($result);
$resultvals = "";
foreach($newmeta as $data){
$game_details="";
$hometeam = "";
$visitorteam = "";
if(trim($data->game_details)!="")
$game_details = $data->game_details;
if($data->visitorteam!=""){ $visitorteam = "<br /><strong>Visitor Team:  </strong>".$data->visitorteam.""; }
if($data->hometeam!=""){ $hometeam = "<br /><strong>Home Team:  </strong>".$data->hometeam.""; }
$gamedate = strtotime($data->game_date);
$gametime = $data->game_time;
$endtime = strtotime('+30 minute',$gametime);
$nowtime = date('Y-m-d h:i:s');
$resultvals = $resultvals."<table class='inner_result'>
<tr class='hdr_3'>
<td colspan='4' >".date("n-d-Y",$gamedate)."<br />
".$gametime."
".$hometeam."
".$visitorteam."
<br /><div class='todays_pick' ><span><strong>Pick:</strong></span>  ".$data->your_pick."<br /><span><strong>Odds:</strong></span>  ".$data->pick_odds." </div>
<br /> ".$game_details."</td>
<td><br />Recommended Unit Play (Risk)<br />
<div class='todays_units' >".$data->units_play." Units</div>
</td>
</tr>
<tr>
</tr>
</table>";
}
echo $resultvals;
}
真棒謝謝! – kma1289