在這種情況下是否有任何錯誤?結果沒有顯示。也許我得到的語法錯了?從sql查詢不顯示變量結果
// fetch the latest tweet
$lastTweet = '';
$q2 = "SELECT tweet FROM timel ORDER BY id DESC LIMIT 1";
list($lastTweet) = $conn->get_results($q2);
if(!$lastTweet){
$lastTweet = "You don't have any tweets yet!";
}
var_dump($lastTweet);
,這對HTML正文:
<span class="latest"><strong>Latest: </strong><span id="lastTweet"><?.=$lastTweet?></span></span>
<?。= $ lastTweet this dot? – 2013-02-20 21:11:00
By <?。=你的意思是<?=? – DiMono 2013-02-20 21:11:01
在'<?。= $ lastTweet?>'中,在'?'和'='之間有'.'。去掉它。 – 2013-02-20 21:14:33