Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zmiana wartości jeżeli wartość pola = BRAK
PoL4K
post 29.06.2011, 15:37:52
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 2.08.2010

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


Witam!

Piszę program i jestem w trakcie pisania systemu autoryzacji.
Program sprawdza login, hasło oraz serial code, który jest przypisywany podczas uruchomienia programu, no i tutaj jest właśnie problem.

Mam taki kodzik:

  1. SELECT username, password, serial FROM users WHERE username='" & TextBox1.Text & "' AND password='" & TextBox2.Text & "' AND IF serial='BRAK' then UPDATE users SET serial = REPLACE(serial, 'BRAK', '" & TextBox3.Text & "') end IF


I wywala mi taki błąd:
  1. 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 'serial='BRAK' then update users set serial = replace(serial, 'BRAK', 'BFEBFBFF00' at line 1


Z góry dzięki za pomoc smile.gif

Ten post edytował PoL4K 29.06.2011, 15:51:23
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: 28.06.2025 - 18:58