3 ms·
It seems pretty weird to design it that way, using a global config. At least name it some other way to avoid name collisions. Maybe add it as an optional second
by bbrizzi 15y ago
It seems pretty weird to design it that way, using a global config. At least name it some other way to avoid name collisions. Maybe add it as an optional second parameter and define it as static.
Also, the mysqli extension should be preferred over mysql so it should come before in the code.
Finally, if your connection fails, $dbconn will be set to false, which is == to null in PHP. You should have two checks on this variable: $dbcon === NULL and $dbconn === false.