Code: Select all
$result = $db->Execute("select id,name from user_stat_types where max_value is null and display_code is null order by name");
Code: Select all
$result = $db->Execute("select id,name from user_stat_types where max_value is null and display_code is null order by name");
Code: Select all
$array = array(2,3,4,5);
//the db query is here and the loop while(!$result->EOF) {
if(!in_array($array,$result->id)
{
//print the contents
}
$result->MoveNext();
//} end of the loop
Code: Select all
<?php
$array = array(2,3,4);
$result = $db->Execute("select id,name from user_stat_types where max_value is null and display_code is null order by name");
$statNames = array();
$nb = array($db->Execute("select id from users"));
while (! $result->EOF)
{
$statNames[$result->fields[0] + 0] = $result->fields[1];
$result->MoveNext();
}
$result->Close();
echo "<table class='plainTable'>";
echo "<tr valign='top'>";
foreach ($statNames as $statId => $statName)
{
echo "<td>";
TableHeader($statName);
echo "<table class='plainTable'>";
$result = $db->Execute("select users.username, user_stats.value from user_stats left join users on users.id = user_stats.user_id where stat_type = ? order by value desc limit 0,50", $statId);
$l = 0;
while (! $result->EOF)
{
if(!in_array($array,$nb))
{
if ($l % 2 == 0)
echo "<tr class='evenLine'>";
else
echo "<tr class='oddLine'>";
echo "<td>{$result->fields[0]}</td><td>{$result->fields[1]}</td>";
echo "</tr>";
}
$result->MoveNext();
$l ++;
}
echo "</table>";
TableFooter();
echo "</td>";
}
echo "</tr>";
echo "</table>";
?>
Code: Select all
<?php
$array = array(2,3,4);
$result = $db->Execute("select id,name from user_stat_types where max_value is null and display_code is null order by name");
$statNames = array();
while (! $result->EOF)
{
$statNames[$result->fields[0] + 0] = $result->fields[1];
$result->MoveNext();
}
$result->Close();
echo "<table class='plainTable'>";
echo "<tr valign='top'>";
foreach ($statNames as $statId => $statName)
{
echo "<td>";
TableHeader($statName);
echo "<table class='plainTable'>";
$result = $db->Execute("select users.username, user_stats.value, users.id from user_stats left join users on users.id = user_stats.user_id where stat_type = ? order by value desc limit 0,50", $statId);
$l = 0;
while (! $result->EOF)
{
if(!in_array($array,$result->id))
{
if ($l % 2 == 0)
echo "<tr class='evenLine'>";
else
echo "<tr class='oddLine'>";
echo "<td>{$result->fields[0]}</td><td>{$result->fields[1]}</td>";
echo "</tr>";
}
$result->MoveNext();
$l ++;
}
echo "</table>";
TableFooter();
echo "</td>";
}
echo "</tr>";
echo "</table>";
?>
Code: Select all
Error: in_array() expects parameter 2 to be array, integer given