所以我有這個查詢裏面搜索torrent_download,torrent_download只能是1或者0;if else sql語句後查詢
$sql_istorrenthere = $this->query("SELECT torrent_download
FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . $item_details['auction_id'] . "'");
if (empty($sql_istorrenthere))
{
$display_output = GMSG_NOTORRENT;}
else
$display_output = GMSG_TORRENT;
}
我想要做的是if (empty($sql_istorrenthere))
喜歡的東西if $sql_istorrenthere == 1 then $display_output = GMSG_NOTORRENT; else $display_output = GMSG_TORRENT;
如何做到這一點更換部件?
'的var_dump($ sql_istorrenthere);' –
@KarolyHorvath我得到這個在類型(MySQL的結果)頁面資源(156)的頂部,但在GMSG –
如何連接到你的數據庫沒有變化?你可能需要使用'$ row = $ sqlistorrenthere-> fetch_assoc(); var_dump($ row);'做完'$ this-> query(...);' – Daan