Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> fetch_array() problem...
kreator
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 3
Dołączył: 19.10.2007
Skąd: Gdańsk

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


Witam wszystkich.

Mam kod funkcji logowania:
Kod
    public function loguj($user,$pass)
    {
        $lacz = $this->laczbd();
        if(!$lacz) return 0;
        $wynik = $lacz->query("select * from users where login='$user' and haslo=MD5('$pass')");
        if(!$wynik)
            return 0;
        if($wynik->num_rows>0)
            return 1;
        else
            return 0;
    }


oraz kod sprawdzajacy i ustawiajacy sesje:
Kod
    public function logowanie()
    {
        if($_GET["akcja"]=="logout")
        {
            unset($_SESSION['zalogowany']);
            session_destroy();
            Header("Location: index.php");
        }    
        
        if($_GET["akcja"]=="login")
        {
            $user = $_POST["login"];
            $pass = $_POST["pass"];
            if($this->loguj($user,$pass))
            {
                $wynik->fetch_array();
                $_SESSION['zalogowany'] = "tak";
                $_SESSION['access'] = $wynik[0];
                $_SESSION['user'] = $wynik[3];
                header("Location: index.php");
            }
        }
    }


Wszystko fajnie tylko pokazuje sie blad:

Fatal error
: Call to a member function fetch_array() on a non-object in /opt/lampp/htdocs/augit/inc/classes.php on line 206

Gdzie jest blad? i jak go naprawic?

Pozdr
Kreator

Ten post edytował kreator 21.10.2007, 16:05:16
Go to the top of the page
+Quote Post

Posty w temacie
- kreator   fetch_array() problem...   21.10.2007, 16:04:33
- - phoenix7   Witam Tak przegladam te funkcje i one znajduja si...   21.10.2007, 18:00:15
- - kreator   Ok... pomoglo. WIelkie dzieki   21.10.2007, 18:09:38


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: 22.08.2025 - 14:49