mysqli_error() expects parameter 1 to be mysqli, null given in own db class

This isn’t a WordPress question it’s a PHP question, but probably what’s happening is that you need to declare global $con everywhere before you both use and set $con.

So in your sql.inc.php put a global $con; before you set it the first time. Then obviously make sure you do global con; before every place you use it.

EDIT:

Using globals in this way is pretty messy when you can control all the code in a self contained but of functionality like this. It’s better when you can to pass variables directly to exactly the places that it’s needed. In this case you should probably pass $con in to the constructor of the class, save it as a private property on the class and then reference it with $this->con instead of globaling it.

The reason for doing this is because when you come to debug or change code, having used global variables makes it very hard to trace the places that you need to change or debug. It’s convenient in the short term but in the long term takes much much more of your time to change and debug later.