Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/01/2021 in all areas

  1. use a join rather than sub queries in the select clause. select u.id, u.user_login, u.user_email, u.user_registered, sub_level.meta_value as sub_level, sub_region.meta_value as sub_region from wp_users u inner join wp_usermeta sub_level on u.id = sub_level.user_id and sub_level.meta_key = 'wp_capabilities' and sub_level.meta_value like '%s2member_%' inner join wp_usermeta sub_region on u.id = sub_region.user_id and sub_region.meta_value like '%county%' Does the region not have an appropriate meta_key value to filter on?
    1 point
  2. the error about an undefined variable is the same problem at the start of your thread in a different help forum. php class methods have local variable scope. if the logic class is truly dependent on the data class, you would use dependency injection to make the instance of the data class available in the logic class. however, i doubt that is actually what you are trying to do. you need to post all the relevant code in order to get the best solution. based on the names you have given your classes, you have taken the data and processing for a task and surrounded each of them with class definitions. this is not OOP. OOP is not about doing a bunch of typing adding a bunch of defining and calling syntax, then adding $var-> or $this-> in front of everything in order to make it work. all this is doing is wasting time adding a layer to your code that adds no value to that you are doing.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.