bluespiked1 Posted July 29, 2012 Share Posted July 29, 2012 Hi everyone, Just started posting here, hoping posting a problem wouldn't be my first post. I just started to create a login page. When I attempt to login I get this: " Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\wamp\www\membership site\classes\Mysql.php on line 9 " The code for the Mysql.php is: <?php require_once 'includes/constants.php'; class Mysql { private $conn; function __construct() { $this->conn = new mysql(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(); if($stmt->fetch()) { $stmt->close(); return true; } } } } ?> Can anyone tell me what my issue is? Thank you so much, all help would be appreciated! Link to comment https://forums.phpfreaks.com/topic/266423-line-issue/ Share on other sites More sharing options...
xyph Posted July 29, 2012 Share Posted July 29, 2012 You're creating a new instance of the class in the constructor. This creates an infinite loop. You may have meant new mysqli Link to comment https://forums.phpfreaks.com/topic/266423-line-issue/#findComment-1365301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.