Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zapisa do Datetime, formatownie daty
Siner
post
Post #1





Grupa: Zarejestrowani
Postów: 159
Pomógł: 6
Dołączył: 2.01.2004

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


Gdy chcem zapisać dane do kolumny DATETIME - robie(próbuje) zrobić to tak
  1. <?
  2. $data = date('Y-m-d H:i:s');
  3. $dodaj = mysql_query(&#092;"INSERT INTO tabela VALUES('$data')\");
  4. ?>

Ale coś chyba źle robie, bo jak sprawdzam co jest nie tak - mysql_error() pokazuje mi
Kod
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 '.0.1, '2004-11-04 19:18:54')' at line 1

Reasumująć chodz mi oto jak sformatowąć datę, żeby to działało?
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: 24.08.2025 - 15:25