Timeline for How do i append UNION SQL Query with default search query
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 22, 2014 at 12:15 | comment | added | birgire |
This filter controls the SELECT fields of the WP_Query() and it's a string, so we need this filter to match the default fields with the ones in your custom SQL query. ps: and don't forget about the plural posts_fields , I sometimes forget about it myself and use post_fields ;-)
|
|
Sep 22, 2014 at 12:10 | comment | added | Mahesh | could you please explain about post_fields method if you have time or do you have any blog which is explianed about this code | |
Sep 22, 2014 at 11:51 | comment | added | birgire | @Mahesh Glad to hear it worked for you. | |
Sep 22, 2014 at 5:30 | vote | accept | Mahesh | ||
Sep 22, 2014 at 5:30 | vote | accept | Mahesh | ||
Sep 22, 2014 at 5:30 | |||||
Sep 22, 2014 at 5:29 | comment | added | Mahesh |
Thanks @Birgire, This Solves my problem. Exactly i am looking for this approach/method. I think this method is the key role player in this class public function posts_fields( $fields ){}
|
|
Sep 20, 2014 at 2:18 | history | edited | birgire | CC BY-SA 3.0 |
edited body
|
Sep 20, 2014 at 2:13 | history | edited | birgire | CC BY-SA 3.0 |
edited body
|
Sep 20, 2014 at 2:07 | history | edited | birgire | CC BY-SA 3.0 |
edited body
|
Sep 20, 2014 at 2:00 | history | edited | birgire | CC BY-SA 3.0 |
added 1747 characters in body
|
Sep 20, 2014 at 1:53 | history | edited | birgire | CC BY-SA 3.0 |
added 1747 characters in body
|
Sep 19, 2014 at 16:25 | history | edited | birgire | CC BY-SA 3.0 |
added 1 character in body
|
Sep 19, 2014 at 16:19 | comment | added | birgire | @Mahesh I updated the answer. | |
Sep 19, 2014 at 16:14 | history | edited | birgire | CC BY-SA 3.0 |
added 1229 characters in body
|
Sep 19, 2014 at 13:50 | comment | added | Mahesh | birgire thanks so much. Actually while using UNION both $request and $sql should select same no of fields. But in this example the $result have (select *) and $sql select 5 fields. So mysql return Error Code 1222. So i want change my approach, i want to append the $sql result to main $request query. | |
Sep 19, 2014 at 12:49 | history | answered | birgire | CC BY-SA 3.0 |