我需要一點幫助,把代碼放在下面的sql代碼中。任何人都可以幫我把下面的代碼放在sql中嗎?
我的代碼 -
torrentlang.name AS lang_name, FROM torrentlang LEFT JOIN torrentlang ON torrentlang = torrentlang.id
我希望把它下面的查詢中:
$query = " SELECT
torrents.id,
torrents.category,
torrents.name,
torrents.image1,
torrents.added,
torrents.size,
torrents.hits,
torrents.banned,
torrents.comments,
torrents.seeders,
torrents.leechers,
torrents.times_completed,
categories.name AS cat_name,
categories.parent_cat AS cat_parent
FROM torrents
LEFT JOIN categories
ON category = categories.id
WHERE categories.parent_cat = 'Movies'
ORDER BY added DESC
LIMIT 2";
$query12 = mysql_query($query)or die(mysql_error());
請幫幫忙!
我需要的結果如下:
$query = "SELECT
torrents.id,
torrents.category,
torrents.name,
torrents.image1,
torrents.added,
torrents.size,
torrents.hits,
torrents.banned,
torrents.comments,
torrents.seeders,
torrents.leechers,
torrents.times_completed,
categories.name AS cat_name,
categories.parent_cat AS cat_parent
FROM torrents
LEFT JOIN categories
ON category = categories.id,
torrentlang.name AS lang_name,
FROM torrentlang
LEFT JOIN torrentlang
ON torrentlang = torrentlang.id
WHERE categories.parent_cat = 'Movies'
AND torrentlang.id = '3'
ORDER BY added DESC
LIMIT 2";
$query12 = mysql_query($query)or die(mysql_error());
請更正上述結果的代碼!
究竟你需要哪些幫助? –
如果您的問題正在加入查詢,則還需要表定義。 – scones
需要在$ query12中放置上面一行「torrentlang」而不更改任何現有代碼 – Jaki