you already had the answer to this problem. do try to read the error message
properly.
a 'non object' is quite clear - if in doubt about what something is or something
should be use var_dump() or print_r() to output the variable in question (e.g.
$DB, which
you would have seen was NULL).
now
change
$rows = $DB-select(SELECT * Users WHERE Email='$Email', AND
Password='$PasswordEncoded');
to
$rows = $this-DB-select(SELECT * Users WHERE
Email='$Email', AND
Password='$PasswordEncoded');
you have to always reference the current instance w/ the $this keyword
I amn trying to use my db class in my auth class, but i get the error:
call to a member function select() on a non object
?php
class db {
// Members
private $db_user = mydbuser;
private $db_pass = mypassword;
private $db_name = mydb;
private
nihilism machine wrote:
// Connect to the database
public function __construct() {
$DB = new db();
Everything Nathan said, plus change the $DB to $this-DB in your
construct() method.
Jim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
4 matches
Mail list logo