Setting up a database class
Unless I'm missing something, your selectRows and insertRows can be used for other operations as well, because you don't actually check that the queries are SELECT or INSERT respectively.  In fact you call insertRows when the consuming code calls deleteRows or updateRows so why have all these functions?

In deleteRows and updateRows, you accept an argument ($bindParams) that you don't use. Why?


  would it be better to have pre-built functions for returning specific
  data (Eg..getFriends())?


In my own work, I put such functions in the User class which can in turn call selectRows with the right parameters.  It still meets your requirement that only the Database class interacts directly with the DB engine. The Database class has no information about other objects. It just executes queries and returns results. The core of my class is similar to:

public $error; //holds text of error if a query fails
private $results; //holds results of most recent query
private $conn; //holds db connection used by all queries

//connects to the database and saves the connection in $conn property
public function __construct($host, $port, $user, $pwd, $db_name)

//disconnect from the database
public function __destruct()

//executes query after binding params. Return TRUE on success or FALSE on error
//stores results in $results property so it can be accessed by other functions
public function query($sql, array $params = null)

//executes a query and returns a row. If no sql is provided,
// returns row from $results property. Return FALSE on error
public function fetch_row($sql = null, array $params = null)

//executes a query and returns the full results table. If no sql is provided,
// returns table from $results property. Return FALSE on error
public function fetch_array($sql = null, array $params = null)


//executes a query and returns the column of interest. If no sql is provided,
// returns column from $results property. Return FALSE on error
 public function fetch_column($column, $sql = null, array $params = null)


At the start of each function, I set $error to null. If there is an error, I fill $error with the details. So the consuming code can check this variable after executing a query to check for errors:

$result = $db-&gt;query(...); // or $db-&gt;fetch_array(...)

if($error_msg = $db-&gt;error):
  //query failed. Details are in $error_msg
else:
  // query succeeded
endif;


Does that help?