In this example, since you are having to write out the entire INSERT query, it would make more send to turn rename the insert()
$data = array( "John", "Smith" );
$sql = "INSERT INTO names ( firstname, lastname) VALUES( ?, ? )";
$db->query( $data, $sql );
It would also seem more intuitive to have the query as the first parameter, and the array of values as an optional second parameter.