• Resolved lidya1859

    (@lidya1859)


    First,,i’m sorry if i’m wrong to post here. I just wanna ask which is the best when i have some detail for each user..is it the best to make multiple user_meta?? i mean something like this

    update_user_meta($id,'address',$address);
    update_user_meta($id,'phone',$phone);
    update_user_meta($id,'point',$point);
    update_user_meta($id,'gender',$gender);

    or just make one user meta and store it in array?? like this:

    $value = array('address'=>$address,'phone'=>$phone,'point'=>$point,'gender'=>$gender);
    update_user_meta($id,'detail-user',$value);

    i don’t get any problem when i’m using the first one..but i reconsider it because i have user around 200.000..but is it really okay if i’m using array?? what’s your opinion??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The anser to this depends on how often you’ll need to access the meta data, and if you’ll ever neet to search through it. If it’s just some extra stuff for you, and you’ll never use it for indexing or searching, then saving it as an array is fine. If you think there’s even a possibility of needing to search by a single value then store them separately. It will amke your life a lot eaiser in the long run. The amount of records in the DB won’t be an issue – MySQL can handle some pretty high numbers, so it’s nothing to be concerned about.

    Thread Starter lidya1859

    (@lidya1859)

    ooo…i see..
    thanks for your answer.. 🙂

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

The topic ‘Multiple user_meta VS Array user_meta’ is closed to new replies.