| @@ 1409-1415 (lines=7) @@ | ||
| 1406 | return ''; |
|
| 1407 | } |
|
| 1408 | ||
| 1409 | if ( is_array( $where ) ) { |
|
| 1410 | global $wpdb; |
|
| 1411 | FrmDb::get_where_clause_and_values( $where, $starts_with ); |
|
| 1412 | $where = $wpdb->prepare( $where['where'], $where['values'] ); |
|
| 1413 | } else { |
|
| 1414 | $where = $starts_with . $where; |
|
| 1415 | } |
|
| 1416 | ||
| 1417 | return $where; |
|
| 1418 | } |
|
| @@ 495-499 (lines=5) @@ | ||
| 492 | self::get_group_and_table_name( $table, $group ); |
|
| 493 | ||
| 494 | $query = 'SELECT ' . $columns . ' FROM ' . $table; |
|
| 495 | if ( is_array( $where ) || empty( $where ) ) { |
|
| 496 | self::get_where_clause_and_values( $where ); |
|
| 497 | global $wpdb; |
|
| 498 | $query = $wpdb->prepare( $query . $where['where'], $where['values'] ); |
|
| 499 | } |
|
| 500 | ||
| 501 | $cache_key = str_replace( array( ' ', ',' ), '_', trim( implode( '_', FrmAppHelper::array_flatten( $where ) ) . $columns . '_results_ARRAY_A' , ' WHERE' ) ); |
|
| 502 | $results = FrmAppHelper::check_cache( $cache_key, $group, $query, 'get_associative_results' ); |
|