Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Zapytanie sql
meehow18
post 14.08.2010, 15:49:05
Post #1





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 10.01.2010

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


Witam,
mam taki skrypt

  1. <?php
  2. $row=mysql_query('SELECT * FROM sklep');
  3. //$row=mysql_query('SELECT idPrzedmiotu FROM item WHERE id=".$row[Id]".');
  4. //$ilosc_wierszy = mysql_num_rows($row);
  5.  
  6. $row='SELECT idPrzedmiotu FROM item WHERE id=".$row[ID]".';
  7. $wynik2=mysql_query($row) or die('BŁĄD:'.mysql_error());
  8. /*
  9. if(mysql_num_rows($row) > 0) {
  10.  
  11.  
  12.  
  13.   echo "<table cellpadding=\"2\" border=1>";
  14.   while($r = mysql_fetch_assoc($row)) {
  15.   echo "<tr>";
  16.   echo "<td>".$r['nazwa']."</td>";
  17.   echo "<td>".$r['img']."</td>";
  18. echo "<td>".$r['idPrzedmiotu']."</td>";
  19. echo "<td>"."<b>Cena:</b>".$r['cred']."</td>";
  20.   echo "<td>
  21.   <a href=\"index.php?a=buy&amp;id={$r['id']}\">KUP</a>
  22.  
  23.   </td>";
  24.   echo "</tr>";
  25.   }
  26.   echo "</table>";
  27. }
  28. else {
  29. echo '<b>Nie ma żadnych przedmiotów</b>';
  30. }
  31. */
  32. ?>
  33.  
  34.  
  35.  
  36.  

i wyswietla mi bład
BŁĄD:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
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 Wersja Lo-Fi Aktualny czas: 19.07.2025 - 21:01