I need a little help in putting a code in the below sql code.
My code is -
torrentlang.name AS lang_name, FROM torrentlang LEFT JOIN torrentlang ON torrentlang = torrentlang.id
I want to put it inside the below query:
$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());
Please help!
I need the result as below:
$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());
Please correct the above result code!