Question
I use this code: $search = $this->wpdb->prepare("WHERE (name LIKE %s OR tag LIKE %s)", '%'. $this->wpdb->esc_like($word) .'%', '%'. $this->wpdb->esc_like($word) .'%'); and in console i get: name LIKE '{4b9ad9b602bd32ff99324feebaa1883bb3a3e818f587b35198d4e48093375c78}night{4b9ad9b602bd32ff99324feebaa1883bb3a3e818f587b35198d4e48093375c78}' OR tag LIKE '{4b9ad9b602bd32ff99324feebaa1883bb3a3e818f587b35198d4e48093375c78}night{4b9ad9b602bd32ff99324feebaa1883bb3a3e818f587b35198d4e48093375c78}' how i can remove this strange string?
0
, 5 days 0 Answers 16 views

Question
What is the basic way to use $wpdb and get_results? This is my code: global $wpdb; $q="SELECT * FROM wp_usermeta WHERE meta_key = 'nickname' AND user_id = 771"; $result = $wpdb->get_results($q); echo $result; The query string is good because I can run it in phpmyadmin and ...
0
, 1 week 0 Answers 25 views

Question
I have custom template and i need get og:image url in header. Class image location in DB wp_postmeta - meta_value i try with functions.php function getOgImage() { global $wpdb; $ogimage = $wpdb->get_results("SELECT DISTINCT post_id FROM wp_postmeta WHERE ...
0
3 weeks 0 Answers 34 views

Question
Is it possible to create a table with the wpdb::prepare function? I read the documentation and tried to find examples but there where none that helped me. Even creating a table with prepare doesn't give me any useful examples on Google. Currently I'm ...
0
, , , 1 month 0 Answers 39 views