Remove db connection and database params db_query()
Add log error param flag
Make sure db queries use db_query and not  mysql_query (needed for mysqli support)