Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][MySQL][PHP]Wgrywanie zdjęć do bazy BLOB
imlegend
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 22.12.2012

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


Hej,

mam taki problem, wgrywam do bazy mysql obrazek i niby wszystko jest ok ale gdy wchodzę do niej to jest cały rekord(login, email, pass i data) tylko pole z moim obrazkiem(data) ma wartośc 0 B
i obrazek nie wyświetla się.
Gdy edytuje rekord z poziomu bazy danych to wybieram plik, wgrywam i wszystko jest ok - wyświetla się.

może mam błąd w formularzu (bo już nie wiem):
  1. <form method="post" action="" enctype="multipart/form-data">
  2. <label for="login">Login:</label>
  3. <input maxlength="32" type="text" name="login" id="login" />
  4.  
  5. <label for="pass">Hasło:</label>
  6. <input maxlength="32" type="password" name="pass" id="pass" />
  7.  
  8. <label for="pass_again">Hasło (ponownie):</label>
  9. <input maxlength="32" type="password" name="pass_v" id="pass_again" />
  10.  
  11. <label for="email">Email:</label>
  12. <input type="text" name="email" maxlength="50" id="email" />
  13.  
  14. <label for="email_again">Email (ponownie):</label>
  15. <input type="text" maxlength="255" name="email_v" id="email_again" /><br />
  16.  
  17. <label for "data">Zdjęcie:</label>
  18. <input type ="file" name = "data" id = "data" />
  19.  
  20.  
  21. <input type="hidden" name="send" value="1" />
  22. <input type="submit" value="Zarejestruj" />
  23. </form>


fragment kodu odpowiedzialny za wgranie do bazy:

  1. mysql_query("INSERT INTO users (login, email, pass, data) VALUES('$login','$email','$pass','$data');") or die ('<p class="error">Wystąpił błąd w zapytaniu i nie udało się zarejestrować użytkownika.</p>');


ktoś ma pomysł ?
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: 16.09.2025 - 22:57