Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Zapytanie MySQL, gdzie jest blad?
Zikerus
post 31.01.2011, 23:43:18
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 1
Dołączył: 22.01.2011

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


Witam, mam taki oto kod:

  1. $q_new = "INSERT INTO `inbox_messages` (`sender_id`, `recipient_id`, `topic`, `message`) VALUES ('{$_SESSION['id']}','{$recp['id']}','{$_POST['topic']}','{$_POST['message']}'";
  2. mysql_query($q_new) or die(mysql_error());


No i moje pytanie jest mysle proste - gdzie w tym zapytaniu jest blad?

Takie oto cudo otrzymuje w nagrode:

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 '' at line 1

Z gory dziekuje za pomoc

Ten post edytował Zikerus 31.01.2011, 23:44:12
Go to the top of the page
+Quote Post
JoShiMa
post 31.01.2011, 23:53:03
Post #2





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

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


A tak próbowałeś:

$q_new = "INSERT INTO `inbox_messages` (`sender_id`, `recipient_id`, `topic`, `message`) VALUES ('".$_SESSION['id']."','".$recp['id']."','".$_POST['topic']."','".$_POST['message']."'";


--------------------
Go to the top of the page
+Quote Post
Zikerus
post 31.01.2011, 23:57:37
Post #3





Grupa: Zarejestrowani
Postów: 19
Pomógł: 1
Dołączył: 22.01.2011

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


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 '' at line 1

Wiec nie zmienilo to niczego

@EDIT

Juz widze blad, brak nawiasu na koncu <sciana>

Ten post edytował Zikerus 31.01.2011, 23:59:12
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: 23.04.2024 - 15:10