require
Hej og godt nytår.Jeg tror jeg har prøvet alt, så nu er jeg ude på at få bekræftet at det ikke kan lade sig gøre, eller?
Har nedenstående:
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td valign="top" align="center">
<?php
$fins = mysql_query("SELECT
aar.aarsid,
aar.byyear,
aar.spiller,
aar.nocut,
aar.round1,
aar.round2,
aar.round3,
aar.treplus,
aar.round4,
aar.firplus,
aar.nocut,
aar.101, aar.102, aar.103, aar.104, aar.105, aar.106, aar.107, aar.108, aar.109, aar.110, aar.111, aar.112, aar.113, aar.114, aar.115, aar.116, aar.117, aar.118,
aar.201, aar.202, aar.203, aar.204, aar.205, aar.206, aar.207, aar.208, aar.209, aar.210, aar.211, aar.212, aar.213, aar.214, aar.215, aar.216, aar.217, aar.218,
aar.301, aar.302, aar.303, aar.304, aar.305, aar.306, aar.307, aar.308, aar.309, aar.310, aar.311, aar.312, aar.313, aar.314, aar.315, aar.316, aar.317, aar.318,
aar.401, aar.402, aar.403, aar.404, aar.405, aar.406, aar.407, aar.408, aar.409, aar.410, aar.411, aar.412, aar.413, aar.414, aar.415, aar.416, aar.417, aar.418,
spi.spillernavn,
spi.id,
par.hul1, par.hul2, par.hul3, par.hul4, par.hul5, par.hul6, par.hul7, par.hul8, par.hul9, par.hul10, par.hul11, par.hul12, par.hul13, par.hul14, par.hul15, par.hul16, par.hul17, par.hul18,
sum(aar.101 + aar.102 + aar.103 + aar.104 + aar.105 + aar.106 + aar.107 + aar.108 + aar.109 + aar.110 + aar.111 + aar.112 + aar.113 + aar.114 + aar.115 + aar.116 + aar.117 + aar.118) AS sejre,
sum(aar.101 + aar.102 + aar.103 + aar.104 + aar.105 + aar.106 + aar.107 + aar.108 + aar.109 + aar.110 + aar.111 + aar.112 + aar.113 + aar.114 + aar.115 + aar.116 + aar.117 + aar.118) - sum(hul1 + hul2 + hul3 + hul4 + hul5 + hul6 + hul7 + hul8 + hul9 + hul10 + hul11 + hul12 + hul13 + hul14 + hul15 + hul16 + hul17 + hul18) AS forskel
FROM aarlige AS aar
INNER JOIN spillere AS spi ON aar.spiller = spi.id
INNER JOIN parslag AS par
WHERE aar.byyear=$aar GROUP BY spi.id ORDER BY forskel ASC ");
while($f=mysql_fetch_array($fins)){
$number = $number + 1;
if($number % 2 == 0){$color="#808080";}else{$color="#606060";}
echo "<table width='240' border='0' cellspacing='0' cellpadding='3'><tr bgcolor='$color'>";
echo "<td width='180' align='left' valign='bottom'><a href=http://www.tourfacts.dk/golf/golfspillere.php?id=$f[id] class='hvid'>$f[spillernavn]</a></td>";
echo "<td width='30' align='center' valign='bottom'>$f[sejre]</td>";
echo "<td width='30' align='center' valign='bottom'>";
if($f['forskel'] == 0)
{
echo "par\n";
}
elseif($f['forskel'] == -1)
{
echo "<font color='red'><strong>-1</strong></font>\n";
}
elseif($f['forskel'] == -2)
{
echo "<font color='red'><strong>-2</strong></font>\n";
}
elseif($f['forskel'] == -3)
{
echo "<font color='red'><strong>-3</strong></font>\n";
}
elseif($f['forskel'] == -4)
{
echo "<font color='red'><strong>-4</strong></font>\n";
}
elseif($f['forskel'] == -5)
{
echo "<font color='red'><strong>-5</strong></font>\n";
}
elseif($f['forskel'] == -6)
{
echo "<font color='red'><strong>-6</strong></font>\n";
}
elseif($f['forskel'] == -7)
{
echo "<font color='red'><strong>-7</strong></font>\n";
}
elseif($f['forskel'] == -8)
{
echo "<font color='red'><strong>-8</strong></font>\n";
}
elseif($f['forskel'] == -9)
{
echo "<font color='red'><strong>-9</strong></font>\n";
}
elseif($f['forskel'] == 1)
{
echo "<font color='blue'><strong>+1</strong></font>\n";
}
elseif($f['forskel'] == 2)
{
echo "<font color='blue'><strong>+2</strong></font>\n";
}
elseif($f['forskel'] == 3)
{
echo "<font color='blue'><strong>+3</strong></font>\n";
}
elseif($f['forskel'] == 4)
{
echo "<font color='blue'><strong>+4</strong></font>\n";
}
elseif($f['forskel'] == 5)
{
echo "<font color='blue'><strong>+5</strong></font>\n";
}
elseif($f['forskel'] == 6)
{
echo "<font color='blue'><strong>+6</strong></font>\n";
}
elseif($f['forskel'] == 7)
{
echo "<font color='blue'><strong>+7</strong></font>\n";
}
elseif($f['forskel'] == 8)
{
echo "<font color='blue'><strong>+8</strong></font>\n";
}
elseif($f['forskel'] == 9)
{
echo "<font color='blue'><strong>+9</strong></font>\n";
}
elseif($f['forskel'] == 10)
{
echo "<font color='blue'><strong>+10</strong></font>\n";
}
elseif($f['forskel'] == 11)
{
echo "<font color='blue'><strong>+11</strong></font>\n";
}
elseif($f['forskel'] == 12)
{
echo "<font color='blue'><strong>+12</strong></font>\n";
}
elseif($f['forskel'] == 13)
{
echo "<font color='blue'><strong>+13</strong></font>\n";
}
elseif($f['forskel'] == 14)
{
echo "<font color='blue'><strong>+14</strong></font>\n";
}
elseif($f['forskel'] == 15)
{
echo "<font color='blue'><strong>+15</strong></font>\n";
}
elseif($f['forskel'] == 16)
{
echo "<font color='blue'><strong>+16</strong></font>\n";
}
elseif($f['forskel'] == 17)
{
echo "<font color='blue'><strong>+17</strong></font>\n";
}
elseif($f['forskel'] == 18)
{
echo "<font color='blue'><strong>+18</strong></font>\n";
}
elseif($f['forskel'] == 19)
{
echo "<font color='blue'><strong>+19</strong></font>\n";
}
elseif($f['forskel'] == 20)
{
echo "<font color='blue'><strong>+20</strong></font>\n";
}
else{
echo "$f[forskel]\n";
}
echo "</td>";
echo "</td></tr></table>";
}
$number = 0;
?>
</td>
</tr>
</table>
som jeg gerne vil ændre til noget i retning af:
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td valign="top" align="center">
<?php
$fins = mysql_query("SELECT
require($_SERVER[DOCUMENT_ROOT'].'/golf/genbrug/select.php');
sum(aar.101 + aar.102 + aar.103 + aar.104 + aar.105 + aar.106 + aar.107 + aar.108 + aar.109 + aar.110 + aar.111 + aar.112 + aar.113 + aar.114 + aar.115 + aar.116 + aar.117 + aar.118) AS sejre,
sum(aar.101 + aar.102 + aar.103 + aar.104 + aar.105 + aar.106 + aar.107 + aar.108 + aar.109 + aar.110 + aar.111 + aar.112 + aar.113 + aar.114 + aar.115 + aar.116 + aar.117 + aar.118) - sum(hul1 + hul2 + hul3 + hul4 + hul5 + hul6 + hul7 + hul8 + hul9 + hul10 + hul11 + hul12 + hul13 + hul14 + hul15 + hul16 + hul17 + hul18) AS forskel
require($_SERVER[DOCUMENT_ROOT'].'/golf/genbrug/join.php');
WHERE aar.byyear=$aar GROUP BY spi.id ORDER BY forskel ASC ");
while($f=mysql_fetch_array($fins)){
$number = $number + 1;
if($number % 2 == 0){$color="#808080";}else{$color="#606060";}
echo "<table width='240' border='0' cellspacing='0' cellpadding='3'><tr bgcolor='$color'>";
echo "<td width='180' align='left' valign='bottom'><a href=http://www.tourfacts.dk/golf/golfspillere.php?id=$f[id] class='hvid'>$f[spillernavn]</a></td>";
echo "<td width='30' align='center' valign='bottom'>$f[sejre]</td>";
echo "<td width='30' align='center' valign='bottom'>";
require($_SERVER[DOCUMENT_ROOT'].'/golf/genbrug/forskel.php');
}
echo "</td>";
echo "</td></tr></table>";
}
$number = 0;
?>
</td>
</tr>
</table>
Skulle der være andre muligheder end 'require' og 'include' der kan bruges?
Svend