• Hello,

    I would like to know if you can help me for a sql query?
    This query works well on phpmyadmin …

    but I would like to integrate this request in my template in php but I can not manage with the class wpdb

    is it possible to do this in php so that i can add to my template?

    select t.name from wp_terms t, wp_term_taxonomy tt, wp_term_relationships tr
    where t.term_id=tt.term_id AND tt.term_taxonomy_id=tr.term_taxonomy_id and tr.object_id=1939

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What is it you’re trying to accomplish?

    Thread Starter pecernet

    (@pecernet)

    I would like to display all the taxonomy, the terms of the product (woocommerce)
    when i use this request via phpmyadmin it works and i would like to succeed the same thing in my template

    thanks

    Thread Starter pecernet

    (@pecernet)

    I find this solution

    $terms = get_the_terms( $post->ID , 'product_brand' ); foreach( $terms as $term ) { print $term->name; unset($term); }

    🙂

    • This reply was modified 7 years, 7 months ago by pecernet.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘help for sql query in template’ is closed to new replies.