aswamy / CURegistrationApp

Developed for course SYSC4504 at Carleton University
0 stars 0 forks source link

getError function for database class does not work for connect errors #2

Closed BenjiWeber closed 9 years ago

BenjiWeber commented 9 years ago

The database class blows up if you do the following:

$db = @new Database(); //Run this will the mysql process is OFF $db->getError();

BenjiWeber commented 9 years ago

I don't want to end up breaking any of your existing usage of this function, but this is how you would fix it if we were using mysqli instead...

$conn = @new mysqli('localhost', 'root', '', 'sysc4504'); //@ suppresses warning output if ($conn->connect_error) //connect_error