Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Asaf Cohen

    (@asaf050)

    Hey, thanks for the fast reply.

    I’m using “category__and” and I get nothing… is something worng with the code? (there is a product at both categories and I didn’t get any PHP errors.

    $query_args = array( 'category__and' => array( 43, 29 ),  'posts_per_page' => 9, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product');
    $r = new WP_Query($query_args);
    Forum: Hacks
    In reply to: Custom mysql query
    Thread Starter Asaf Cohen

    (@asaf050)

    Get it work! thank you very much!
    this is my query now:

    $author_subscriper = $wpdb->get_results(“SELECT * from $wpdb->usermeta WHERE meta_key = ‘last_name’ ORDER BY BINARY meta_value”);

    Forum: Hacks
    In reply to: Custom mysql query
    Thread Starter Asaf Cohen

    (@asaf050)

    Thanks for your comment, INNER JOIN isn’t needed beacuse I’m currectly using the user meta table.
    This is my query right now:
    $author_subscriper = $wpdb->get_results(“SELECT * from $wpdb->usermeta WHERE meta_key = ‘wp_capabilities’ AND meta_value = ‘a:1:{s:10:\”subscriber\”;b:1;}’ AND WHERE meta_key =’last_name’ ORDER BY ‘meta_value'”);

    Isn’t working for me… (It doesn’t show result at all)
    Looking forward for your replay, thanks 🙂

    Forum: Hacks
    In reply to: Custom mysql query
    Thread Starter Asaf Cohen

    (@asaf050)

    Yes I tried, the problem is that there is no column named “last_name”.
    There is meta_key clolum that the value his’last_name’ and his ‘meta_value” is tha last name.
    for example:
    umeta_id.user_id…meta_key..meta_value
    5……………5……..last_name..Jacson
    21………….1……..last_name..Weston
    27………….3……..first_name.Bill
    30………….3……..last_name..Gates

    Thread Starter Asaf Cohen

    (@asaf050)

    Thanks!! works

Viewing 5 replies - 1 through 5 (of 5 total)