Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Blad przy update.
goartur
post 16.01.2015, 20:53:20
Post #1





Grupa: Zarejestrowani
Postów: 233
Pomógł: 27
Dołączył: 19.10.2014

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


Czesc, mam problem mam forme po nacisnieciu przycisku powinien nastapic UPDATE.

Error:
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 'll post here my work and I hope you will like it. I hope you have a nice day.' at line 1

php

  1. <?php
  2. $idUpdate = $_POST['id'];
  3. $titleUpdate = $_POST['title'];
  4. $contentUpdate = $_POST['content'];
  5. $dateUpdate = $_POST['date'];
  6.  
  7. if(isset($_POST['update'])){
  8. mysql_query("UPDATE blogData SET title = '".$titleUpdate."' AND content = '".$contentUpdate."' AND date = '".$dateUpdate."' WHERE id = '".$idUpdate."'") or die(mysql_error()); ;
  9. echo("'".$titleUpdate."'<br> '".$contentUpdate."'<br>'".$dateUpdate."'<br>'".$idUpdate."'");
  10. };
  11. ?>


Moze ktos mi wytlumaczyc to?
Pierwszy raz widze taki blad.
Go to the top of the page
+Quote Post
Pyton_000
post 16.01.2015, 21:01:43
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

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


manual -> addslashes (znak ' w tekście)
Go to the top of the page
+Quote Post
goartur
post 16.01.2015, 21:12:21
Post #3





Grupa: Zarejestrowani
Postów: 233
Pomógł: 27
Dołączył: 19.10.2014

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


Nadal nie rozumie.
Go to the top of the page
+Quote Post
Pyton_000
post 16.01.2015, 21:15:27
Post #4





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

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


$_POST['title']; -> addslashes i content tak samo
Go to the top of the page
+Quote Post

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: 13.06.2025 - 15:57