Mi potete spiegare cosa non va in questo codice?
Codice PHP:
<? include ("config.forum.php");
$sql = "SELECT phpbb_forums.forum_name, phpbb_topics.topic_title, ";
$sql .= ' IF(phpbb_posts.poster_id = -1, IF(phpbb_posts.post_username = "", "Ospite", phpbb_posts.post_username), ';
$sql .= " phpbb_users.username) AS username, ";
$sql .= " phpbb_posts.post_time, phpbb_forums.forum_id, phpbb_topics.topic_id, phpbb_users.user_id, ";
$sql .= " phpbb_posts.post_id, phpbb_posts.poster_id ";
$sql .= "FROM phpbb_forums, phpbb_topics, phpbb_users, phpbb_posts ";
$sql .= "WHERE phpbb_posts.poster_id = phpbb_users.user_id ";
$sql .= " AND phpbb_posts.topic_id = phpbb_topics.topic_id ";
$sql .= " AND phpbb_posts.forum_id = hpbb_posts.topic_id ";
$sql .= " AND phpbb_forums.auth_read <> 2 ";
$sql .= "ORDER BY phpbb_posts.post_time DESC ";
$sql .= "LIMIT 0 , 5";
$result = mysql_query($sql, $db);
while ($row = mysql_fetch_array($result))
{ echo "$row[username]";
}
Ovviamente ho voluto solo vedere l'username per testare il codice ma non va!
nel file config.forum.php ci sono tutti i parametri di connessione al database del forum!
Cosa sbaglio?