Risultati da 1 a 3 di 3

Discussione: CLASSE PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource

  1. #1
    L'avatar di catellostefano
    catellostefano è offline Utente del Forum
    Data Registrazione
    Dec 2008
    Messaggi
    522

    CLASSE PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource

    Salve,
    stò sviluppando una classe di login, ma sono arrivato dinanzi ad un errore, credo banale, mi dice: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, string given in classi/login/PostingLogin.class.inc.php on line 26

    ora so che questo errore spunta nel momento che sbaglio la query, ma vi garantisco che è corretta. sotto c'è il codice, vi ringrazio anticipatamente.
    ciao


    Codice PHP:
            private $IdentificativoPOST;
            private 
    $PasswordPOST;
            private 
    $tokenPOST;

            private 
    $PasswordMd5;
            private 
    $tokenSESSION;

            private 
    $datiDB;
            private 
    $IdentificativoDB;
            private 
    $PasswordDB;

            public function 
    __construct()
                {
                    
    $this->IdentificativoPOST $_POST['Identificativo'];
                    
    $this->PasswordPOST $_POST['Password'];
                    
    $this->tokenPOST $_POST['token'];

                    
    $this->PasswordMd5 md5($this->PasswordPOST);
                    
    $this->tokenSESSION $_SESSION['token'];
                    
                    
    $this->datiDB mysql_fetch_array("SELECT * FROM Utenti WHERE Identificativo = '" $this->IdentificativoPOST "'");
                    
                    
    $this->IdentificativoDB $this->datiDB['Identificativo'];
                    
    $this->PasswordDB $this->datiDB['Password'];
                } 

  2. #2
    L'avatar di alessandro1997
    alessandro1997 è offline Super Moderatore
    Data Registrazione
    Oct 2009
    Località
    Roma
    Messaggi
    5,144
    Nel codice che hai postato non è presente nessuna chiamata a mysql_fetch_assoc. Posta il file completo.

  3. #3
    L'avatar di catellostefano
    catellostefano è offline Utente del Forum
    Data Registrazione
    Dec 2008
    Messaggi
    522
    Come dicevo era un errore banale, mancava proprio il codice di connessione al DB.
    grazie ciao

Permessi di Scrittura

  • Tu non puoi inviare nuove discussioni
  • Tu non puoi inviare risposte
  • Tu non puoi inviare allegati
  • Tu non puoi modificare i tuoi messaggi
  •