Object of class .. could not be converted to string

前端 未结 1 1253
傲寒
傲寒 2021-02-14 14:56

I made my first class and I\'m having trouble converting the objects back into strings.

class Cryption
{
    var $data;
    var $salt;

function __construct($dat         


        
1条回答
  •  感情败类
    2021-02-14 15:35

    Look at this lines:

    $password->sha512();
    
    $result = mysql_query("SELECT * FROM `administrators` WHERE username='$username' and password='$password'");
    

    $password is an object. It should be:

    $pw = $password->sha512();
    
    $result = mysql_query("SELECT * FROM `administrators` WHERE username='$username' and password='$pw'");
    

    0 讨论(0)
提交回复
热议问题