从meta_key中具有相同行的meta_value返回数据

发布于 2025-02-04 05:14:11 字数 484 浏览 3 评论 0原文

请参阅此处的表图:

[1]: https://i.sstatic.net/kjwiq.png 显示来自“ designs_save_user_list”的数据 在所有包含'counce_parent'use的User_id中,元value中的数字相同?

我只能看到用户的数据,但是我想看到每个在Account_parent中具有相同数字的人

当前代码是:

if(is_user_logged_in()){
        $user_ID = get_current_user_id();       
        $get_designs_list = get_user_meta($user_ID, 'designs_save_user_list', true);

See image of the table here:
[1]: https://i.sstatic.net/KjWIQ.png

How do I show data from 'designs_save_user_list'
of all user_id that contain 'account_parent' and with the same number in the meta_value?

I'm only able to see the data of a user, but I want to see everyone who has the same number in the account_parent

the current code is:

if(is_user_logged_in()){
        $user_ID = get_current_user_id();       
        $get_designs_list = get_user_meta($user_ID, 'designs_save_user_list', true);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴意少年 2025-02-11 05:14:11
       if(is_user_logged_in()){
                $user_ID = get_current_user_id();       
                $account_parent = get_user_meta($user_ID, 'account_parent', true);
                if (isset($account_parent) && $account_parent == 2 ){
                    $get_designs_list = get_user_meta($user_ID, 'designs_save_user_list', 
                    true); 
           }
    }

检查此代码是否适合您

       if(is_user_logged_in()){
                $user_ID = get_current_user_id();       
                $account_parent = get_user_meta($user_ID, 'account_parent', true);
                if (isset($account_parent) && $account_parent == 2 ){
                    $get_designs_list = get_user_meta($user_ID, 'designs_save_user_list', 
                    true); 
           }
    }

check this code if its work for you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文