Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> wyzwalacz po update
nono91
post
Post #1





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 26.10.2014

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


Cześć chcę po aktualizacji artykułu modyfikować datę , robię to w ten sposób:
  1. CREATE TRIGGER modifyDate
  2. AFTER UPDATE ON articles
  3. FOR EACH ROW BEGIN
  4. UPDATE articles
  5. SET dateModify = CURRENT_TIMESTAMP
  6. WHERE id=OLD.id
  7. END;


lecz niestety podczas tworzenia pojawia się błąd:
#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 'END' at line 7
Go to the top of the page
+Quote Post
bpskiba
post
Post #2





Grupa: Zarejestrowani
Postów: 340
Pomógł: 49
Dołączył: 3.07.2009
Skąd: Rzeszów

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


brak średnika na końcu 6 linii (IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif) (IMG:style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
mmmmmmm
post
Post #3





Grupa: Zarejestrowani
Postów: 1 421
Pomógł: 310
Dołączył: 18.04.2012

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


Do takich rzeczy używa się ON UPDATE CURRENT_TIMESTAMP
Go to the top of the page
+Quote Post

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: 15.09.2025 - 18:13