Establish a connection to a mysql server (main or replicate)
static public establishDBConnection ( $use_slave, $required, $display = true ) | ||
$use_slave | try to connect to slave server first not to main server | |
$required | connection to the specified server is required (if connection failed, do not try to connect to the other server) | |
$display | display error message (true by default) |