/**
 * Returns a statement of the form:
 *
 * tablename.hashval1 as \"hashkey1\", ...
 *
 * based on the KEYS in the $column_key_hash variable.  useful to build a
 * query that only needs a couple of columns returned.
 *
 * fifers: should probably base this on an indexed array instead...
 */
function getColumnsViaHashKeysFrom($tablename, $column_key_hash, $whereclause = '')
{
    // get the table information
    $pntable =& pnDBGetTables();
    $query = getColumnsViaHashKeys($tablename, $column_key_hash) . "FROM {$pntable[$tablename]} ";
    if (!empty($whereclause)) {
        $query .= "WHERE {$whereclause}";
    }
    return $query;
}
/**
 * Returns a statement of the form:
 *
 * tablename.hashval1 as \"hashkey1\", ...
 *
 * based on the KEYS in the $column_key_hash variable.  useful to build a
 * query that only needs a couple of columns returned.
 *
 * fifers: should probably base this on an indexed array instead...
 */
function getColumnsViaHashKeysFrom($tablename, $column_key_hash, $whereclause = '')
{
    global $pntable;
    $query = getColumnsViaHashKeys($tablename, $column_key_hash) . "FROM {$pntable[$tablename]} ";
    if (!empty($whereclause)) {
        $query .= "WHERE {$whereclause}";
    }
    return $query;
}