I've got a script that shows torrents without seeds and i want it to show the uploader, but i keep getting the error: unknown table 'torrents' in where clause
but in the MySQL command line client it works.
the code is:
$owner = mysql_query("SELECT username FROM users WHERE users.id = torrents.owner AND torrents.banned = 'no' AND torrents.seeders = 0 LIMIT 1") or die (mysql_error());
$need_seeds = mysql_query("SELECT id, name FROM torrents WHERE banned = 'no' AND seeders = 0 ORDER BY name ASC");
if (mysql_num_rows($need_seeds) > 0) {
while ($row = mysql_fetch_arrays($owner, MYSQL_NUM)) {
$uploader = "$row[0]";
while ($row2 = mysql_fetch_array($need_seeds, MYSQL_NUM)) {
echo 'If you have any of the following on your hard drive please help out the leechers and seed:<BR><BR><BR>';
echo "<a href=\"torrents-details.php?id=$row2[0]\">$row2[1]</a><BR>"; echo "Uploaded By: $username";
}
}
} else {
echo "No Torrents Are Needing Seeds At The Moment";
}
and the table torrents does exist as the $need_seeds query works.
it's the $owner query that keeps saying the torrents table doesn't exist.