Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Niepoprawne zapytanie: Unknown column 'artist_id' in 'where clause'
powertee
post
Post #1





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

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


Witam mam problem, wydaje mi sie ze kod jest wporządku ale wyświetla mi coś takiego:

Niepoprawne zapytanie: Unknown column 'artist_id' in 'where clause'

szukałem troche i znalazłem ze dzieje sie tak z przejsciaz mysql4 na mysql 5.
podobno da sie przerobić kod zeby działał a ja nie mamam pojęcia jak...
no i teraz stare dobre hasło: POMOŻECIE?questionmark.gif rolleyes.gif

  1. <?
  2. $link = mysql_connect("localhost", "xxx", "xxx")
  3. or die("nie udalo sie poilaczyc: " . mysql_error());
  4. mysql_select_db("baza", $link)
  5. or die("cos jest nie tak!!! " . mysql_error());
  6.  
  7. $convert['artist'] = 'wybranego wykonawce' ; $convert['song'] = 'wybrany utwór';
  8.  
  9. /* USUWANIE */
  10.  
  11. if (!isset($_GET['do']) && $_GET['do'] != 1) {
  12. ?>
  13. <p align="center" style="color:#FF0000">
  14. Czy napewno chcesz usunąć 
  15. <?php
  16. echo $convert[$_GET['type']]; ?>?<br>
  17. <a href="<? echo $_SERVER['REQUEST_URI']; ?>&do=1">tak</a>
  18.  lub <a href="index.php">nie</a>
  19. </p>
  20. <?
  21. } else 
  22. { 
  23. if ($_GET['type'] == "artist") {
  24. $artista = "UPDATE song
  25. SET id_artist_song = '0'
  26. WHERE id_artist_song = '" . $_GET['id'] . "'";
  27. $result = mysql_query($artista)
  28. or die("Niepoprawne zapytanie xxx : " . mysql_error());
  29. }
  30. $sql = "DELETE FROM " . $_GET['type'] . "
  31. WHERE " . $_GET['type'] . "_id = '" . $_GET['id'] . "'
  32. LIMIT 1";
  33. echo "<!--" . $sql . "==>";
  34.  
  35. $result = mysql_query($sql) or die("Niepoprawne zapytanie: " . mysql_error());
  36. ?>
  37. <p align="center" style="color:#FF0000">
  38. Wybrany <? echo $convert[$_GET['type']]; ?> został usuniety.
  39. <a href="index.php"> Powrót do listy</a></p>
  40. <?
  41. }
  42. ?>


Ten post edytował powertee 18.01.2008, 18:27:58
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 22.08.2025 - 00:41