I'm using the below SQL to create a table from wordpress user information joining data in u3g_users and u3g_metavalue.
SELECT u3g_users.`ID`, u3g_users.`display_name` AS `Name`, u3g_users.`user_email` AS `Email`, u3g_users.`user_login` AS `Login (Email)`, u3g_usermeta.`meta_value` AS `Address #1` FROM u3g_users INNER JOIN u3g_usermeta ON u3g_users.`ID` = u3g_usermeta.`user_id` WHERE meta_key = '#address1'
The code as it is shows 2 users out of 183 that have actual values for the
meta_key set as #address1
I'm trying to expand the code to show the following but can't seem to get there.
The current code shows me the results of just two user where the
meta_valuehas a value. I need it to show ALL Users even if the
meta_keyalso contains additional sections for which I need to expand on for example #address #2 I've tried to make a repetition to show a sixth column which should be '#Address2' for example the column headings would be Name, Email, Login(Email), Address #1, Address #2
The goal is to create an SQL code that combines
u3g_meta_value with repeating columns of
meta_value so that the user can see a better defined user database on the front end even is the data is blank
Any pointers would be great
Thanks in Advanced