开发者

mySQL private/conn issues

I'm having some issues with a 1&1 account a client of mine is hosted with. I'm getting errors on lines 2 & 20 (denoted as bold below), which doesn't make sense as they're basic php functions.

I've used this same script dozens of times with no issues, until putting it on this 1&1 account. Is anyone seeing something I may be missing?

class Mysql 
{
  private $conn;

  function __construct() 
  {
    $this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or 
       die('There was a problem connecting to the database.');
  }

  function verify_Username_and_Pass($un, $pwd) 
  {  
    $query = "SELECT * FROM users WHERE username = ? AND password = ? LIMIT 1";

    if ($stmt = $this->conn->prepare($query)) {
      $stmt->bind_param('ss', $un, $pwd);
      $stmt->execute();
    }
}

Thanks in advance!

EDIT:

thanks pinkgothic for reminding me to put the errors on here >.<

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/24/d100728/htdocs开发者_开发技巧/members/classes/Mysql.php on line 6

^thats for the private class

Fatal error: Call to a member function on a non-object in /homepages/24/d100728/htdocs/members/classes/Mysql.php on line 20

^when the private line is commented out, im able to reach the login screen but get this error on submission.

Also, the database is running MySQL5.0.


If its failing on the private variable declaration, it could be running PHP 4, as there was no way to make private class properties til PHP 5.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜