Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][MySql] unknown column in 'where clause'
arkoslaw
post
Post #1





Grupa: Zarejestrowani
Postów: 21
Pomógł: 1
Dołączył: 31.10.2009

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


Witam serdecznie, mam pewien problem wyswietleniem informacji o koncie dla zalogowanego użytkownika

  1. include("logowanie.php");
  2.  
  3. $query = mysql_query("SELECT * FROM `users` WHERE 'login'='".$_SESSION['user']."'");
  4. $result = mysql_query ($query) or die ("Wystapil blad: " . mysql_error ());
  5.  
  6. $tab=mysql_fetch_array($result);
  7.  
  8. while($tab = mysql_fetch_array($result))
  9. {

no i dalej jest wyswietlanie wynikow. Po wykonaniu tego zapytania wywala mi komunikat: unknown 'nazwa loginu' in where clause.

Kombinowalem z apostrofami i teraz wywala mi inny komunikat :
"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 'Resource id #7' at line 1".

Z tym unknown column to chyba dlatego, że jeśli sie nie da pojedynczego apostrofu to interpretuje to jako nazwe kolumny...no ale one sa, wiec nie wiem w czym rzecz. Miał ktoś taki problem?

Ten post edytował arkoslaw 8.11.2009, 18:11:20
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: 4.10.2025 - 16:57