Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][mysql] unexpected $end
powertee
post
Post #1





Grupa: Zarejestrowani
Postów: 58
Pomógł: 0
Dołączył: 13.12.2007
Skąd: Katowice/Goleniowy

Ostrzeżenie: (0%)
-----


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. ?>


Ten post edytował powertee 15.01.2008, 18:23:00
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
nevt
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 595
Pomógł: 282
Dołączył: 24.09.2007
Skąd: Reda, Pomorskie.

Ostrzeżenie: (0%)
-----


brakuje ci EOD; między 33 a 34 linijką...
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 23:29