Using mysqli instead of mysql

mysql is deprecated.

[admin part is yet to be replaced]