0

Notice: Undefined property: stdClass::$testing@e-mail.com in C:\wamp\www\classes\Profile.class.php を返します

私は解決策が近いことを知っています.しかし、なぜですか? 助けてください。

コードは次のとおりです。

$this -> set('userFname', $this -> p -> get_value_by_Profile("testing@e-mail.com"));

function get_value_by_Profile($value){
         return $this->get_from_table("user",$value,"userID",1);    
    }


function get_from_table($table,$value,$column,$where){

    $this->dbo->setFetchMode(Zend_Db::FETCH_OBJ);

    $select = $this->dbo->select()
    ->from($table)
    ->where($column.' = ?', $where);
    $obj =  $this->dbo->fetchRow($select);  

    if($obj)
    return $obj->$value;    
    }
4

2 に答える 2

1

returnステートメントを次のように変更してみてください。

return $obj->$column; 
于 2013-03-09T16:29:52.740 に答える
0
you read you code carefully you are retuning 
$obj->testing@e-mail.com; 
but you need to return 
$obj->userID;
means return 
$obj->$column;
于 2013-03-09T16:40:52.393 に答える