转义后写的正确语法是什么?
("SELECT torrent_download
FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . $item_details['auction_id'] . );
我得到的错误是意外的')'
我尝试了各种 " 和 ' 但似乎没有一个工作
看起来您在 final 之前缺少一个结束语'
,它会用双引号括起来$item_details['auction_id']
)
"'");
("SELECT torrent_download
FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . $item_details['auction_id'] . "'");
为了在双引号字符串中节省一点麻烦,我建议使用{}
附件而不是连接所有引号。但是,您不能将常量 括起来DB_PREFIX
。
("SELECT torrent_download
FROM " . DB_PREFIX . "auctions WHERE
auction_id='{$item_details['auction_id']}'");
("SELECT torrent_download
FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . $item_details['auction_id'] . "'");
你试过吗?又是“后跟”。
("SELECT torrent_download
FROM " . DB_PREFIX . "auctions WHERE
auction_id='" . $item_details['auction_id'] ."'" );