Jump to content

[SOLVED] Syntax error somewhere here!!


BigX

Recommended Posts

Hi,

 

can anyone tel me what is the syntax error in the code shown below! The error gives a T-stirng error and it's supposed to be in the url part that is in the final section!! Help is greatly appreciated!  :D

 

<?php 
$query = "SELECT u.firstname_usr, u.lastname_usr, p.totaal_poulefase, p.totaal_kwartfinales, p.totaal_halvefinales, p.totaal_finale_topscorer, p.totaal_alles FROM ekpoule_users AS u INNER JOIN puntentelling AS p ON u.id_usr = p.id ORDER BY p.totaal_alles DESC";
$tussenstand = mysql_query($query);

echo "<table width='590' cellspacing='0' border='1'>
<tr>
<th width='20' style='border: 1px solid black' bgcolor='#CC0000'><div class='style11'><b>#</b></div></th>
<th width='150' style='border: 1px solid black' bgcolor='#CC0000'><div align='center' class='style11'><u><b>Deelnemer</b></u></div></th>
<th style='border: 1px solid black' bgcolor='#006DAE'><div align='center' class='style11'><u><b>Poulefase</b></u></div></th>
<th style='border: 1px solid black' bgcolor='#006DAE'><div align='center' class='style11'><u><b>Kwartfinales</b></u></div></th>
<th style='border: 1px solid black' bgcolor='#006DAE'><div align='center' class='style11'><u><b>Halvefinales</b></u></div></th>
<th style='border: 1px solid black' bgcolor='#006DAE'><div align='center' class='style11'><u><b>Finale</b></u></div></th>
<th style='border: 1px solid black' bgcolor='#031F4E'><div align='center' class='style11'><u><b>Totaal</b></u></div></th>
</tr>";

$color1 = "#FFFFFF";  
$color2 = "#CCCCCC";  
$teller = 1;
while($row = mysql_fetch_array($tussenstand, MYSQL_ASSOC))
{

$row_color = ($teller % 2) ? $color1 : $color2;

  echo "<tr>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'>" . $teller . "</div></td>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'><a href="deelnemer.php?id_usr=" . $row['id_usr'] . "">" . $row['firstname_usr']." ".$row['lastname_usr'] . "</a></div></td>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'>" . $row['totaal_poulefase'] . "</div></td>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'>" . $row['totaal_kwartfinales'] . "</div></td>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'>" . $row['totaal_halvefinales'] . "</div></td>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'>" . $row['totaal_finale_topscorer'] . "</div></td>";
  echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center' class='style12'>" . $row['totaal_alles'] . "</div></td>";
  echo "</tr>";
  $teller++;
}
echo "</table>";
?>

Link to comment
https://forums.phpfreaks.com/topic/109150-solved-syntax-error-somewhere-here/
Share on other sites

No idea which bold line you're talking about, but I'm 95% sure the error totally caused by this line:

echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'><a href="deelnemer.php?id_usr=" . $row['id_usr'] . "">" . $row['firstname_usr']." ".$row['lastname_usr'] . "</a></div></td>";

 

Change it to:

echo "<td style='border: 1px solid black' bgcolor='$row_color'><div align='center'><a href=\"deelnemer.php?id_usr=" . $row['id_usr'] . "\">" . $row['firstname_usr']." ".$row['lastname_usr'] . "</a></div></td>";

 

And it should be all good.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.