BigX Posted June 7, 2008 Share Posted June 7, 2008 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! <?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 More sharing options...
DarkWater Posted June 7, 2008 Share Posted June 7, 2008 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. Link to comment https://forums.phpfreaks.com/topic/109150-solved-syntax-error-somewhere-here/#findComment-559888 Share on other sites More sharing options...
BigX Posted June 7, 2008 Author Share Posted June 7, 2008 Yeah you were right about that part! That indeed was the problem! So I know get the links but it shows: deelnemer.php?id_usr= but there should be a number!! Do you have any ideas why it doesn't show the number that it's supposed to? Thanx Link to comment https://forums.phpfreaks.com/topic/109150-solved-syntax-error-somewhere-here/#findComment-559939 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.