Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5534

MariuszEm on "WP_query and MySQL lost connection"

$
0
0

Hi there,

I've encountered filtering problem. What have I done:

<?php
  $query_array = array('relation' => 'OR');
    array_push($query_array,
    array(
      'key' => 'filter1',
      'value' => 'value1',
      'compare' => 'LIKE'
    ),
    array(
      'key' => 'filter1',
      'value' => 'value2',
      'compare' => 'LIKE'
    ),
    array(
      'key' => 'filter1',
      'value' => 'value3',
      'compare' => 'LIKE'
    )
  );

  $args = array(
    'order' => $order_array,
    'meta_key' => $meta_key,
    'orderby'   => $orderby,
    'post_type' => 'page',
    'paged' => $paged,
    'post__in' => $postIDs,
    'posts_per_page' => 12,
    'paged' => get_query_var('paged'),
    'meta_query' => $query_array
  );

  query_posts($args);
  ?>

And here is what I recieve when debug mode is TRUE (wp-config):

WordPress database error: [Lost connection to MySQL server during query]

And red colored query:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postme[...]

What else can I say? When I remove third array, everything works like a charm. It doesn't matter which one. When it is array of 4 (relation=>OR,0=>1st array,1=>2nd array,2=>3rd array ) its collapse. When it is array of 3, 2 and 1, then it works.

Any idea? Is it memory problem? could it be?


Viewing all articles
Browse latest Browse all 5534

Latest Images

Trending Articles



Latest Images