Injections and query
What you did well


Storing sensitive information, such as the database connection parameters, separately from the source code is a good idea.
You used parameterized queries with placeholders, which are not vulnerable to SQL injection.


Things to work on


Your indentation is inconsistent.
tryconn() should not echo 'ok' on success, as that pollutes the output.
$a is a horrible name for your database handle.  It's conventionally called $db or something like that.