Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php][mysql] unexpected $end
Forum PHP.pl > Forum > Przedszkole
powertee
Wyświetla coś takiego i nie mam pojęcia gdzie lezy bład...
Parse error: syntax error, unexpected $end in C:\xampp\test\nowe.php on line 55

  1. <?
  2. $link = mysql_connect("localhost", "szatxxx", "kxpxx3")
  3. or die(mysql_error());
  4. or die (mysql_error());
  5. $query = "SELECT title, id_artist_song, rok_prem" .
  6. "FROM song" ;
  7. $result = mysql_query($query, $link)
  8. or die (mysql_error());
  9. $num_song = mysql_num_rows(result);
  10. $song_header=<<<EOD
  11. <h2><center>Baza danych muzyki</center></h2>
  12. <table width="70%" border="1" cellpading="2" cellspacing="2" align="center">
  13. <tr>
  14.    <th>Tytuł utworu</th>
  15.    <th>Wykonawca</th>
  16.    <th>Rok premiery</th>
  17. </tr>
  18. </table>
  19. EOD;
  20. $song_details = '';
  21. while ($row =mysql_fetch_array($result))
  22. {
  23. $title = $row['title'];
  24. $id_artist_song = $row['id_artist_song'];
  25. $rok_prem = $row['rok_prem'];
  26.  
  27. $song_details .=<<<EOD
  28. <tr>
  29.   <td>$title</td>
  30.   <td>$id_artist_song</td>
  31.   <td>$rok_prem</td>
  32. </tr>
  33. }
  34.  
  35. $song_details .=<<<EOD
  36. <tr>
  37.   <td>&nbsp;</td>
  38. </tr>
  39. <tr>
  40.  <td>Łącznie filmów: $num_song</td>
  41. </tr>
  42. EOD;
  43.  
  44. $song_footer ="</table>";
  45.  
  46. $song =<<<SONG
  47. $song_header
  48. $song_details
  49. $song_footer
  50. SONG;
  51.  
  52. echo "W bazie danych znajduje sie $num_song utworów.";
  53. echo $song;
  54. ?>
nevt
brakuje ci EOD; między 33 a 34 linijką...
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.