Just searching for a bit of exhortation on the best way to deal with this:
In the past (many moons back) when I did an intermittent php/mysql work, it was moderately simple to pull/show information from a table utilizing the table header in the “WHERE” inquiry. (for example SELECT * FROM ‘table’ WHERE ‘section name’ = ‘inquiry’).
The tables would have sections for each snippet of data like email, telephone, address, etc.
I am presently dealing with an undertaking utilizing a table that was introduced into the data set by a module where I need to utilize a portion of that information in an alternate space of the site not identified with the plugin.
Instead of a segment for each kind of data as over, this table has
- a user_id segment which is connected to the clients wordpress account
- user_id a meta_key segment. This segment has sections like location, telephone number, and so forth (these eventual the segment names in my above example)
- a meta_value segment. This segment holds the information for each sort of meta_key (the real location, telephone number, etc.)
What I am hoping to do is get the incentive for every thing for a specific user_id and pre-fill a structure that is submitted.
So their User ID, Name and email are pulled from the clients table of the WP data set when they are signed in utilizing the wp_get_current_user() work.
When I have the User ID, I then, at that point need to show that client’s location, telephone number and so forth from the other table in my structure yet I’m stuck on the sql query
Something like:
global $wpdb;
$current_user = wp_get_current_user();
$uid = $current_user->ID;
$table = $wpdb_>prefix . 'module table';
I then, at that point need to choose the client’s location and telephone number and so forth and show them as individual bits of information, so:
$mobile
$address
$studentnumber
so that I can utilize them where needed
What would be the right method to question the data set to get the information I’m looking for?
Hope that all made sense…