English 中文(简体)
Wordpress - How do Iproducts the final query used by query_posts?
原标题:Wordpress - How do I output the last query used by query_posts?

我正试图把所有职位浪费在一个具体的日子(即:今天),但出于某种原因,它只是退回。

$wp_posts = query_posts(array(
             cat  => 4,
             post_status  => array( any ,  publish ,  future ,  inherit ,  revision ,  pending ), 
             year  =>  2011 ,
             monthnum  =>  10 ,
             day  =>  25 ,                  
             order_by  =>  post_date ,
             order  =>  ASC 
            ));

这应当把今天的所有员额归入一个类别,但无论出于何种原因,它只是产出1个员额,我不知道为什么。

我首先认为,这可能是一个永久通道问题,但我删除了永久通道,仍然只是回到一个职位?

在我的当地赞助下,该守则进行细微的工作,并产出一天所需的所有内容。

此外,我还检查了数据库,当天的所有员额都已经到位,似乎已经安排或张贴。

因此,没有理由把询问——职位只归还一个项目。

我想得出最后的问询——调查造成问题的原因。

我怎么会把问询所用的最后询问结果 output成?

感谢。

Edit。

我将接受这样的回答,即把上述问题变成一个我可以用来看到正在经历的那种ver。

最佳回答
问题回答

the last query is always stored in $wpdb->last_query and for post queries as well in $wp_query->request





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签