I notice on the server that the mediapress folders are organised by user ID then the subfolders also have numbers..
What SQL query can I run in phpmyadmin that will give me a list of matching ID’s to user name and folder number to album name ?
Thanks in advance..
Thank you for the question.
Here is a query that will list user name, directory_path
SELECT user_login, CONCAT( "wp-content/uploads/mediapress/members/", ID) FROM wp_users
Please change wp_users to your users table name.
Here is a query that lists user, user_gallery and user_gallery path
SELECT user_login, CONCAT( user_login, "/" , post_title) as user_gallery, CONCAT( "wp-content/uploads/mediapress/members/", wp_users.ID, "/", wp_posts.ID ) as user_gallery_path FROM wp_posts, wp_users WHERE post_author=wp_users.ID AND post_type="mpp-gallery" AND post_status="publish"
Please make sure to change wp_posts & wp_users with the correct table name(you might have a different prefix than wp).
Here is how it should look.
Hope that helps.
The topic ‘ [Resolved] Match Folder names to users and albums via SQL’ is closed to new replies.