• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[HELP PLEASE] Most Powerfull Guilds on latestnews

VitorNM

New Member
Joined
Sep 18, 2015
Messages
10
Reaction score
0
Hello guys. I'm trying to place in my gesior latestnews the "most powerfull guilds" system, but in all cases, i have an error with this line: " LIMIT 0, 4;') as $guild)" PLEASE anybody can help me?

Sorry for my bad english, i'm trying :s

Here is the script i'm using:
$time = time();
$main_content .= '<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
<table border="0">
<tr>
<td style="text-align: center; font-weight: bold;">
<font color="gold">Most powerfull guilds</font>
</td>
</tr>
</table>
</div>
</div>
<table border="0" cellspacing="3" cellpadding="4" width="100%" bgcolor="#D4C0A1">
<tr>';


foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
`g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags`
FROM `killers` k
LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
GROUP BY `name`
ORDER BY `frags` DESC, `name` ASC
LIMIT 0, 4;') as $guild)
$main_content .= ' <td style="width: 25%; text-align: center;">
<a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guilds/' . ((!empty($guild['logo']) && file_exists('guilds/' . $guild['logo'])) ? $guild['logo'] : 'default_logo.gif') . '" width="64" height="64" border="0"/><br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
</td>';


$main_content .= ' </tr>
</table>';

the error is:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\pages\latestnews.php on line 42

#BUMP
 
Last edited by a moderator:
i have posted only the most powerfull guilds script, not the latestnews full page... this error LIMIT 0, 4;') as $guild) is on line 42 the entire page's script.

#UP
 
Last edited by a moderator:
i don't know where i take this, but i just copy and paste in latest news this spoiler... i think i need to execute any sql query, but i don't know
 
Back
Top