Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MySQL]System profili
Wampir
post
Post #1





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 26.02.2012
Skąd: Wrocław

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


Witam!
Mam tabelę, a w niej kolumny takie jak:

id_user - id właściciela
pet_name - nazwa zwierzątka
pet_type - płeć
level - poziom

Chcę, aby wyświetlało mi to wszystko po wejściu w np. profil.php?id=2

Kod:
  1. <html>
  2. <head>
  3. <meta http-equiv="content-type" content="text/html; charset=utf-8" >
  4. <title> localhost.pl :: <?php echo $name; ?></title>
  5. <link rel="stylesheet" href="theme/style.css" type="text/css">
  6. <link rel="Shortcut icon" href="theme/favicon.png" />
  7. </head>
  8.  
  9. <?php
  10. require ("config/polacz.php");
  11.  
  12. $id = $_GET['id'];
  13. $name = $_GET['name'];
  14.  
  15. $sql = mysql_query("SELECT * FROM `adoptions` WHERE `pet_type`, `level`, `user` = '$pet_type', '$level', '$user'") or die('BŁĄD:'.mysql_error());
  16. while($row = mysql_fetch_array($sql)) {
  17. $name; <br>
  18. <b>Płeć:</b> '.$row['pet_type'].' <br>
  19. <b>Właściciel:</b> $id; <br>
  20. <b>Poziom:</b> '.$row['level'].' <br>
  21. ';
  22. }
  23.  
  24.  
  25. ?>


A, tutaj zwrócony błąd
Kod
BŁĄD:Something is wrong in your syntax obok ' `level`, `user` = '', '', ''' w linii 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 Aktualny czas: 22.08.2025 - 19:12