Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL] Problem z zapisem do bazy danych, Problem z INSERTem
Tomplus
post
Post #1





Grupa: Zarejestrowani
Postów: 1 884
Pomógł: 231
Dołączył: 20.03.2005
Skąd: Będzin

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


Witam,
Mam problemik i nie wiem jak go rozwiązać.

mam zapytanie z PHP
  1. <?php
  2. $pytaj = zapytaj("INSERT INTO `ski_users` (`user`, `haslo`, `email`, `register`, `reg_code`)
  3. VALUES (Tom, 2dec995c, tomplus@gmail.com, 2008-02-10 20:44:19, 83sdsds16fdf5);");
  4. ?>


I nie wiem co jest źle, bo wpis nie powoduje zapisu do bazy.
Struktura wygląda tak
id int(12) No auto_increment
user varchar(16) No
haslo varchar(128) No
email varchar(64) No
register datetime Yes NULL
reg_code varchar(16) Yes NULL

i błąd jaki mi wywala to:
  1. SQL query:
  2.  
  3. INSERT INTO `ski_users` ( `user` , `haslo` , `email` , `register` , `reg_code` )
  4. VALUES (
  5. Tom, 2dec995c, tomplus@gmail.com , 2008 -02 -1020 :44 :19, 83sdsds16fdf5
  6. )
  7.  
  8. MySQL said: Documentation
  9. #1064 - 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 '@gmail.com, 2008-02-10 20:44:19, 83sdsds16fdf5)' at line 2
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
heaven
post
Post #2





Grupa: Nieautoryzowani
Postów: 92
Pomógł: 15
Dołączył: 21.10.2006

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


zapominasz o cudzyslowiach

  1. <?php
  2. $pytaj = zapytaj(&#092;"INSERT INTO 'ski_users' ('user', 'haslo', 'email', 'register', 'reg_code')
  3. VALUES ('Tom', '2dec995c', 'tomplus@gmail.com', '2008-02-10 20:44:19', '83sdsds16fdf5');");
  4. ?>


no wlasnie tak jak mnie ubiegł poprzednik (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował heaven 10.02.2008, 21:16:57
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: 7.10.2025 - 02:06