Modifying database using POSTed variables in PHP
If I were you, I'd create a function that looked like this:

function getArrayValues( array $array, array $keys)
{
    $result = array();
    foreach($keys as $key)
    {
        if (!isset($array[$key]))
        {
            throw new RuntimeException($key.' is not set');
        }
        $result[$key] = $array[$key];
    }
    return $result;
}


This function will return an array, containing just those keys you were actually looking for. Then, in your try-catch block, I'd write this:

$values = getArrayValues($_POST, array('var1','var2','var3'));
$stmt = $db-&gt;prepare('your query here');
$stmt-&gt;execute($values);


And that's it.
Now I do have some worries/thoughts/suggestions about your code, but I'll add them in a future edit.

Edit:
You're throwing exceptions when an array-key does not exist. In this particular case, that might be desirable. You can't insert a row in your db, lest all data is at hand. I get that. But how often might you end up writing either:

try
{
    $var = demandArrayValue($someArray, 'isNotSet');
}
catch(Exception $e)
{
    $var = 'default value';
}


Or, to avoid having to write the try-catch too many times: 

$var = isset($someArray['notSet'] ? $someArray['notSet'] : 'default value';


You could write 2 distinct functions: one throwing exceptions, one that doesn't, but that's just silly. getting array-keys shouldn't throw an exception. your code should be able to handle a missing parameter.
What's more, you place the demandArrayValue in the same try-catch block as all of your DB operations. If you're using PDO, and you've set the PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION, then you're actually handling 2 distinct exceptions in the same catch block:

catch(Exception $e)
{//you have to catch Exception, since that's what demandArrayValue throws
    if ($e instanceof PDOException)
    {
        $db-&gt;rollBack();
        echo $e-&gt;getMessage();//handle DB exception
    }
    else
    {
        echo $e-&gt;getMessage();//handle other Exception
    }
}


Now, that's not nice. Besides, like I said before: dealing with the request parameters is something that is, actually, quite a complex task, but most, if not all frameworks, implement a (series of) request objects. You can write your own, too. 
Once you've done that, you can actually use the getKey or get or getAll methods you might implement:

class PostRequest
{
    private $raw = null;
    private $data = null;
    public function __construct(array $data = null)
    {
        $data = $data ?: $_POST;
        $this-&gt;raw = $data;
        $this-&gt;setData();
    }
    public function get($name, $default = null)
    {
        if (isset($this-&gt;data[$name]))
        {
            return $this-&gt;data[$name];
        }
        return $default;
    }
    private function setData()
    {
        $this-&gt;data = array();
        foreach ($this-&gt;raw as $k =&gt; $v)
        {//validate, sanitize, decode... do whatever
            $this-&gt;data[$k] = trim($v);
        }
        return $this;
    }
}


You could expand on this basic template, with custom email validation, or number formatting and what have you, but you could just  as well implement some form of constant-system, to set the get method's behaviour:

const POST_EXCEPTION = 1;
const POST_DEFAULT = 0;
private $exceptionMode = false;

public function setExceptionMode($exceptionMode = self::POST_DEFAULT)
{
    $this-&gt;exceptionMode = !!$exceptionMode;
    return $this;
}
public function get($name, $default = null)
{
    if (!isset($this-&gt;data[$name]))
    {
        if ($this-&gt;exceptionMode === true)
        {
            throw new Exception($name. ' key is not set');
        }
        return $default;
    }
    return $this-&gt;data[$name];
}


This get method does everything yours does, and more... but please, do look into the linked answer, and look into how other frameworks deal with the request. It's all been done before, and you're free to copy with pride