WordPress $wpdb->get_results returns only one row

I’m totally confused.
I run 2 the same queries, one with $wpdb, the other via mysql_query (also checked via phpmyadmin)
First query returns ONLY ONE row:

$wpdb->get_results("SELECT * FROM wp_terms WHERE slug LIKE '%info%' ORDER BY name ASC");

mysl_query returns 42 rows. The same result if run the query via phpmyadmin.

Read More
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
  mysql_selectdb(DB_NAME,$con);
  $res=mysql_query("SELECT * FROM wp_terms WHERE slug LIKE  '%info%' ORDER BY name ASC",$con);
  while($obj=mysql_fetch_object($res)) {
    var_dump($obj);
  }

How can it be ??

$wpdb->show_errors();
$wpdb->print_error();

show no errors.

Related posts

Leave a Reply

1 comment

  1. Try:

    $wpdb->get_results("SELECT * FROM $wpdb->terms WHERE slug LIKE '%info%' ORDER BY name ASC", ARRAY_A );
    

    Do you have plugins that might interfere with the database?