I am a beginner/terrible when it comes to PHP/SQL, keep that in mind. Ok, so what I am trying to do is print some "values" or whatever you could call them with PHP/SQL, like this:
<?PHP
require_once
?>
Now this works just fine.
I am a beginner/terrible when it comes to PHP/SQL, keep that in mind. Ok, so what I am trying to do is print some "values" or whatever you could call them with PHP/SQL, like this:
<?PHP
require_once
?>
Now this works just fine.
Just add them like you added the rest of your select columns.
require_once("dbb.php");
$SQL="select
date_format(timestamp,'%Y %M %d') as datum,
arena.namn as arena,
concat(hemma.lagnamn,'-',borta.lagnamn)as lag,
(select count(*) from mål where matchID=matchID and hemma.lagID=hemma) as h,
(select count(*) from mål where matchID=matchID and borta.lagID=borta)as b,
publiksiffror,
hemmagoal,
bortagoal
from
matcher
inner join
lag as hemma
on hemma.lagID = hemma
inner join
lag as borta
on borta.lagID = borta
inner join
arena
on matcher.arena=arena.arenaID;";
$result = mysql_query($SQL) or die(mysql_error());
while($rad = mysql_fetch_row($result))
{
echo "<tr>";
echo "<td>" . $rad[0] . "</td>";
echo "<td>" . $rad[2] . "</td>";
echo "<td>" . $rad[3] . "</td>";
echo "<td>" . $rad[4] . "</td>";
echo "<td>" . $rad[1] . "</td>";
echo "<td>" . $rad[5] . "</td>";
echo "</tr>";
}
?>