Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php+mysql] problem z mysql_query
-foxiu-
post
Post #1





Goście







mam bardzo dziwny problem.

Kod
//costam

    $query = "select Email from klienci where Email = '" . $_SESSION['login'] . "'";
    print $query . "<br>";
    $result = mysql_query("SELECT Email FROM klienci WHERE Email='foxiu'");
    if (!($result)) { print "Nie ma takiego usera!!"; print mysql_fetch_array($result); }
    else {
        $query1 = "select Haslo from klienci where Email=" . $_SESSION['login'];
        $result1 = mysql_query($query1);
        if (mysql_fetch_array($result1, MYSQL_ASSOC) == $_SESSION['passwd']) {
      $_SESSION['zalogowany'] = true;
      $_SESSION['udanelogowanie'] = true;
        }
    }


//cośtam


a efekt tego jest taki:

select Email from klienci where Email = 'foxiu'
Nie ma takiego usera!!
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\usr\krasnal\www\sklep\engine\login1.php on line 25

problem jest dziwny, ponieważ w całej tabeli klienci mam tylko jeden rekord, a polu Email jest foxiu...

dodam jeszcze ze w iinym kawałku kodu zapytanie typu 'select * from producenci' przechodzi, a juz 'select * from producenci where Nazwa='Abus' ' nie przechodzi, pomimo istnienia w tej tabeli producenta o nazwie Abus. wie ktoś co jest grane?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


Może tak :
  1. <?php
  2. //...
  3. $query1 = &#092;"select Haslo from klienci where Email='\" . $_SESSION[ 'login' ] . \"'\";
  4. //...
  5. ?>
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: 13.10.2025 - 19:16