vpx_db_query_select

Versions
mediamosa-174
vpx_db_query_select($a_query, $a_options = array(SQL_CALC_FOUND_ROWS => FALSE))

Simple creation of the select query See media_management_search for example

Parameters

array $a_query

Return value

string

▾ 72 functions call vpx_db_query_select()

media_management_asset_collect in media_management/media_management_asset.inc
media_management_asset_collect in media_management/media_management_asset.inc
media_management_asset_collect in media_management/media_management_asset.inc
vpx_acl_access_check_mediafiles in vpx_acl/vpx_acl_access.inc
Check access on objects using given array asset_ids
vpx_acl_access_check_mediafiles in vpx_acl/vpx_acl_access.inc
Check access on objects using given array asset_ids
vpx_acl_access_check_mediafiles in vpx_acl/vpx_acl_access.inc
Check access on objects using given array asset_ids
vpx_acl_access_check_on_object in vpx_acl/vpx_acl_access.inc
Check access on a single object
vpx_acl_access_check_on_object in vpx_acl/vpx_acl_access.inc
Check access on a single object
vpx_acl_access_check_on_object in vpx_acl/vpx_acl_access.inc
Check access on a single object
vpx_acl_build_access in vpx_acl/vpx_acl_access.inc
Returns the aut_ids of the given domain and realms
vpx_acl_build_access in vpx_acl/vpx_acl_access.inc
Returns the aut_ids of the given domain and realms
vpx_acl_build_access in vpx_acl/vpx_acl_access.inc
Returns the aut_ids of the given domain and realms
vpx_acl_group_get in vpx_acl/vpx_acl.module
/autorisation_group/$groupname/ | GET
vpx_acl_group_get in vpx_acl/vpx_acl.module
/autorisation_group/$groupname/ | GET
vpx_acl_group_get in vpx_acl/vpx_acl.module
/autorisation_group/$groupname/ | GET
vpx_acl_group_hostname_get in vpx_acl/vpx_acl.module
/autorisation_group/$groupname/hostname/ | GET
vpx_acl_group_hostname_get in vpx_acl/vpx_acl.module
/autorisation_group/$groupname/hostname/ | GET
vpx_acl_group_hostname_get in vpx_acl/vpx_acl.module
/autorisation_group/$groupname/hostname/ | GET
vpx_acl_group_list in vpx_acl/vpx_acl.module
/autorisation_group/
vpx_acl_group_list in vpx_acl/vpx_acl.module
/autorisation_group/
vpx_acl_group_list in vpx_acl/vpx_acl.module
/autorisation_group/
vpx_db_query_select_union in vpx_shared/vpx_shared_db.inc
vpx_db_query_select_union in vpx_shared/vpx_shared_db.inc
vpx_db_query_select_union in vpx_shared/vpx_shared_db.inc
vpx_ftp_batch_assets_get in vpx_ftp_batch/vpx_ftp_batch.module
REST CALL | GET
vpx_ftp_batch_assets_get in vpx_ftp_batch/vpx_ftp_batch.module
REST CALL | GET
vpx_ftp_batch_assets_get in vpx_ftp_batch/vpx_ftp_batch.module
REST CALL | GET
vpx_ftp_batch_list in vpx_ftp_batch/vpx_ftp_batch.module
/ftp_batch/
vpx_ftp_batch_list in vpx_ftp_batch/vpx_ftp_batch.module
/ftp_batch/
vpx_ftp_batch_list in vpx_ftp_batch/vpx_ftp_batch.module
/ftp_batch/
vpx_shared_count_rows in vpx_shared/vpx_shared.module
Rewrite of vpx_count_rows(), does not match its input(!)
vpx_shared_count_rows in vpx_shared/vpx_shared.module
Rewrite of vpx_count_rows(), does not match its input(!)
vpx_shared_count_rows in vpx_shared/vpx_shared.module
Rewrite of vpx_count_rows(), does not match its input(!)
vpx_statistics_get_historical_uploaded_mediafiles in vpx_statistics/vpx_statistics.module
vpx_statistics_get_historical_uploaded_mediafiles in vpx_statistics/vpx_statistics.module
vpx_statistics_get_historical_uploaded_mediafiles in vpx_statistics/vpx_statistics.module
vpx_statistics_get_most_popular_collections in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 meest populaire collections. RTO:4
vpx_statistics_get_most_popular_collections in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 meest populaire collections. RTO:4
vpx_statistics_get_most_popular_collections in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 meest populaire collections. RTO:4
vpx_statistics_get_most_popular_mediafiles in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 meest populaire mediafiles. RTO:2
vpx_statistics_get_most_popular_mediafiles in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 meest populaire mediafiles. RTO:2
vpx_statistics_get_most_popular_mediafiles in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 meest populaire mediafiles. RTO:2
vpx_statistics_get_most_popular_streams in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van populaire streams STATS:7
vpx_statistics_get_most_popular_streams in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van populaire streams STATS:7
vpx_statistics_get_most_popular_streams in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van populaire streams STATS:7
vpx_statistics_get_most_popular_words in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de meest gezochte woorden STATS:8
vpx_statistics_get_most_popular_words in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de meest gezochte woorden STATS:8
vpx_statistics_get_most_popular_words in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de meest gezochte woorden STATS:8
vpx_statistics_get_newest_collections in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 nieuwste collections. RTO:3
vpx_statistics_get_newest_collections in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 nieuwste collections. RTO:3
vpx_statistics_get_newest_collections in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de 50 nieuwste collections. RTO:3
vpx_statistics_get_newest_mediafiles in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de laatste 50 mediafiles. RTO:1
vpx_statistics_get_newest_mediafiles in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de laatste 50 mediafiles. RTO:1
vpx_statistics_get_newest_mediafiles in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de laatste 50 mediafiles. RTO:1
vpx_statistics_get_requested_streams in vpx_statistics/vpx_statistics.module
vpx_statistics_get_requested_streams in vpx_statistics/vpx_statistics.module
vpx_statistics_get_requested_streams in vpx_statistics/vpx_statistics.module
vpx_statistics_get_searchrequest in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de meest gezochte woorden STATS:9
vpx_statistics_get_searchrequest in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de meest gezochte woorden STATS:9
vpx_statistics_get_searchrequest in vpx_statistics/vpx_statistics.module
Opvragen van een overzicht van de meest gezochte woorden STATS:9
vpx_statistics_get_used_diskspace in vpx_statistics/vpx_statistics.module
vpx_statistics_get_used_diskspace in vpx_statistics/vpx_statistics.module
vpx_statistics_get_used_diskspace in vpx_statistics/vpx_statistics.module
_media_management_search_asset in media_management/media_management_search.inc
Search on the assets using given search parameters
_media_management_search_asset in media_management/media_management_search.inc
Search on the assets using given search parameters
_media_management_search_asset in media_management/media_management_search.inc
Search on the assets using given search parameters
_media_management_search_collection in media_management/media_management_search.inc
_media_management_search_collection in media_management/media_management_search.inc
_media_management_search_collection in media_management/media_management_search.inc
_media_management_search_mediafiles in media_management/media_management_search.inc
_media_management_search_mediafiles in media_management/media_management_search.inc
_media_management_search_mediafiles in media_management/media_management_search.inc

Code

vpx_shared/vpx_shared_db.inc, line 141

<?php
function vpx_db_query_select($a_query, $a_options = array(SQL_CALC_FOUND_ROWS => FALSE)) {
  assert(isset($a_query[VPX_DB_QUERY_A_FROM]));

  $a_query[VPX_DB_QUERY_A_SELECT_OPTIONS] = array();
  if (isset($a_options[SQL_CALC_FOUND_ROWS]) && $a_options[SQL_CALC_FOUND_ROWS]) {
    $a_query[VPX_DB_QUERY_A_SELECT_OPTIONS] = array(SQL_CALC_FOUND_ROWS);
  }

  if (isset($a_query['b_allow_distinct']) && $a_query['b_allow_distinct'] && !isset($a_query[VPX_DB_QUERY_A_HAVING])) {
    $a_query[VPX_DB_QUERY_A_SELECT_OPTIONS][] = "DISTINCT";
    unset($a_query[VPX_DB_QUERY_A_GROUP_BY]);
  }

  $a_db_query[] = "SELECT";
  $a_db_query[] = implode(" ", $a_query[VPX_DB_QUERY_A_SELECT_OPTIONS]);

  if (!isset($a_query[VPX_DB_QUERY_A_SELECT_EXPR]) || empty($a_query[VPX_DB_QUERY_A_SELECT_EXPR])) {
    $a_query[VPX_DB_QUERY_A_SELECT_EXPR][] = "*";
  }

  $a_db_query[] = implode(",", $a_query[VPX_DB_QUERY_A_SELECT_EXPR]);
  $a_db_query[] = "FROM";
  $a_db_query[] = implode(",\n", $a_query[VPX_DB_QUERY_A_FROM]);

  // Joins
  if (isset($a_query[VPX_DB_QUERY_A_JOIN])) {
    $a_db_query[] = vpx_db_query_joins($a_query[VPX_DB_QUERY_A_JOIN]);
  }

  // Where
  if (isset($a_query[VPX_DB_QUERY_A_WHERE]) && !empty($a_query[VPX_DB_QUERY_A_WHERE])) {
    $a_db_query[] = "\nWHERE";
    $a_db_query[] = vpx_db_where($a_query[VPX_DB_QUERY_A_WHERE]);
  }

  if (isset($a_query[VPX_DB_QUERY_A_GROUP_BY]) && !empty($a_query[VPX_DB_QUERY_A_GROUP_BY])) {
    $a_db_query[] = "\nGROUP BY";
    $a_db_query[] = implode(", ", $a_query[VPX_DB_QUERY_A_GROUP_BY]);
  }

  if (isset($a_query[VPX_DB_QUERY_A_HAVING]) && !empty($a_query[VPX_DB_QUERY_A_HAVING])) {
    $a_db_query[] = "\nHAVING";
    $a_db_query[] = implode(", ", $a_query[VPX_DB_QUERY_A_HAVING]);
  }

  if (isset($a_query[VPX_DB_QUERY_A_ORDER_BY]) && !empty($a_query[VPX_DB_QUERY_A_ORDER_BY])) {
    $a_db_query[] = "\nORDER BY";
    $a_db_query[] = implode(", ", $a_query[VPX_DB_QUERY_A_ORDER_BY]);
  }

  if (isset($a_query[VPX_DB_QUERY_I_LIMIT])) {
    $a_db_query[] = sprintf("\nLIMIT %d", db_escape_string($a_query[VPX_DB_QUERY_I_LIMIT]));

    if (isset($a_query[VPX_DB_QUERY_I_OFFSET]) && $a_query[VPX_DB_QUERY_I_OFFSET] > 0) {
      $a_db_query[] = sprintf("\nOFFSET %d", db_escape_string($a_query[VPX_DB_QUERY_I_OFFSET]));
    }
  }

  return implode(" ", $a_db_query);
}
?>