Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Unknown column
powertee
post
Post #1





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

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


Z kodem chyba wszysto ok, łaczy sie i wogule ale wyskakuje komunikat "Unknown column 'title' in 'field list' "
nie wiem o co chodzi
nazwa bazy mysql: "baza"
tabela "song"
wszystkie pola które chce wczytać istnieją (title, id_artist_song, rok_prem)
  1. <?
  2. $link = mysql_connect("localhost", "xxxx", "kxxxx3")
  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. EOD;
  34. }
  35.  
  36. $song_details .=<<<EOD
  37. <tr>
  38.   <td>&nbsp;</td>
  39. </tr>
  40. <tr>
  41.  <td>Łącznie filmów: $num_song</td>
  42. </tr>
  43. EOD;
  44.  
  45. $song_footer ="</table>";
  46.  
  47. $song =<<<SONG
  48. $song_header
  49. $song_details
  50. $song_footer
  51. SONG;
  52.  
  53. echo "W bazie danych znajduje sie $num_song utworów.";
  54. echo $song;
  55. ?>


Ten post edytował powertee 15.01.2008, 18:51:10
Go to the top of the page
+Quote Post

Posty w temacie


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: 27.09.2025 - 09:47