mysql - Can't get `post_id` from table `postmeta` in wordpress -


I can not find a list of post_id from the table postmeta . This is my code.

  function getPostID () {global $ wpdb; $ ListID = $ wpdb- & gt; Get_results ("Choose` qan_postmeta` from `post_ id` where 'meta_value` =' news'"); }  

My query is working with mysql, I make changes to 'get_var', 'get_row', but it is not working.

Try it out:

  $ query = $ wpdb-> ; Get_results ("SELECT * FROM` wp_postmeta 'ou meta_value = 0 and meta_key REGEXP' ^ [a-zA-Z]. * $ 'ORDER BY' wp_postmeta '.`meta_value` ASC"); Print_r ($ query);  

All posts in the wp_postmeta table are Metas. We need to select the field starting from the characters. (No "_");

So I use REGEXP in the SQL statement. Happy coding


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -