Database in Class for Reusability Does this code fine for database reusability?

&lt;?php
/**
 * Database
 *
 * Class for handling database connections
 *
 * 
 * @category   Global Class
 * @copyright  ---          
 * @license    ---    
 * @version    1.0
 * @link       ---
 * @since      File available since Release 1.0
 * @created    ---
 * @modified   ---
 * @author     Original Author &lt;---&gt;
 * @author     Future Author &lt;---&gt;
 */

class Database
{
    private $database_connection = null;

    public function __construct( $database_id )
    {
        $database_host     = '';
        $database_name     = '';
        $database_username = '';
        $database_password = '';

        switch ( $database_id ) {
            case 'db1':
                $database_host     = 'host';
                $database_name     = 'name';
                $database_username = 'user';
                $database_password = 'pass';
                break;
            case 'db2':
                $database_host     = 'host';
                $database_name     = 'name';
                $database_username = 'user';
                $database_password = 'pass';
                break;
            default:
                trigger_error( 'Undefined database id', E_USER_ERROR );
        }

        try {
            $this-&gt;database_connection = new PDO( "mysql:host={$database_host};
                                                  dbname={$database_name}",
                                                  $database_username,
                                                  $database_password );

            $this-&gt;database_connection-&gt;setAttribute( PDO::ATTR_ERRMODE,
                                                      PDO::ERRMODE_EXCEPTION );
        } catch ( PDOException $pdo_exception ) {
            trigger_error( $pdo_exception, E_USER_ERROR );
        }

        if ( empty( $this-&gt;database_connection ) ) {
            trigger_error( 'Undefined database connection', E_USER_ERROR );
        }       
    }

    public function execute_query( $query, $statement_id, $values )
    {
        $statement = $this-&gt;database_connection-&gt;prepare( $query );

        if ( $statement_id == 'db1' ) {
            $statement-&gt;bindParam( ':id', $values[ 0 ] );
        } else if ( $statement_id == 'db2' ) {
            $statement-&gt;bindParam( ':id1', $values[ 0 ] );
            $statement-&gt;bindParam( ':id2', $values[ 1 ] );
        } else {
            trigger_error( 'Undefined statement id', E_USER_ERROR );
        }

        $statement-&gt;execute();

        return $statement;
    }
}


?>

and call it here like this?

&lt;?php
require once( "database.php" );

$database_1 = new Database( "db1" );
$database_2 = new Database( "db2" );

$database_1-&gt;execute_query( "SELECT * FROM user WHERE id = :id", "db1", array( 0 ) );
$database_1-&gt;execute_query( "SELECT * FROM user WHERE id = :id", "db1", array( 1 ) );
$database_2-&gt;execute_query( "SELECT * FROM user WHERE id = :id1 AND id2 = :id2", "db2", array( 0, 1 ) );
$database_2-&gt;execute_query( "SELECT * FROM user WHERE id = :id1 AND id2 = :id2", "db2", array( 2, 3 ) );


?>
No, this code isn't reusable. 

Currently, you cannot "execute queries" but execute SELECT queries with exactly one or two parameters. What if you need to add a third id? Or a fourth? Or have a query with no parameters?

The easiest way to solve your problem is to just pass your $values array to execute:

public function execute_query( $query, $statement_id, $values )
{
    $statement = $this-&gt;database_connection-&gt;prepare( $query );
    $statement-&gt;execute($values);
    return $statement;
}


But this still doesn't make very much sense. Your function returns a PDO statement, which still has to be processed, so you didn't really gain anything by introducing this method (well, you save one line for every query you write).

You should either get rid of it and use PDO directly (or some alternative such as an ORM), or you should handle all PDO related code inside of this method (make sure that the method actually improves on using just PDO though).

Misc


It is pretty much never a good idea to change the behavior of a function based on some control string (like your db1/db2), as it is difficult to use, it must be properly documented, it can easily lead to bugs, etc. In your case, you could simply get rid of the parameter and ask for the size of $values. 
$statement_id is poorly named.
You use the same db1/db2 string for two very different things (one for different database credentials, one for the number of ids. This is very confusing.