Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8113401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:49:01+00:00 2026-06-06T02:49:01+00:00

I don’t know MySQL very well so I need a bit of help with

  • 0

I don’t know MySQL very well so I need a bit of help with this task.. I hope it’s ok to ask.

I have a table that i need to export which i did using the following code:

SELECT *
FROM `members`
WHERE `active` =1
AND `level` = 'full'
LIMIT 0 , 30000

This works perfect and gives me most of what I need including a user ID in the collumn called id but I also need to grab the related image for each member and add it to my exported .csv.

The images (filename) are stored in a different table called images but this only contains galleryid, filename and defaultimg (note I am only interested in data where defaultimg = 1)

The issue here is there is NO reference to the member (id) in this table.

For that I have to reference a different table called: imagelinks which contains 2 columns:

1) id which relates to my galleryid from the images table.

and

2) memberid which relates to the user ID id from the members table.

What a disaster of a setup I know.

So.. what I need to do and can’t for the life of me work out is export a .csv with ALL the user data from the members table (as stated in my code above) with the addition of the filename data from the images table that coresponds to the referenced user (where defaultimg = 1).

Lastly, I also need to prepend a URL to the front of the filename data.

eg: The table has my-image.jpg but in the exported .csv I need it to be http://www.domain.com/images/my-image.jpg

I’m trying to do all of this in PhpMyAdmin.

Any help with this will be very much appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:49:03+00:00Added an answer on June 6, 2026 at 2:49 am

    My syntax might be a bit off but this should be close…

    SELECT members.*, CONCAT(‘http://www.domain.com/images/’, images.filename) AS thefilename FROM members INNER JOIN imagelinks ON members.id=imagelinks.memberid INNER JOIN images ON images.galleryid=imagelinks.id WHERE members.active=1 AND members.level=’full’ AND images.defaultimg=1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't overthink this - there's a very commonly used term and I ... have
Don't know if this is the right place to ask this, but I will
Don't know if this is possible, but I have some code like this: val
Don't know if this has been answered before. Have custom routes to users. If
don't know if this is possible.. I'm using sqlite3 schema: CREATE TABLE docs (id
Don't ask me why but i can't use this method because I need to
Don't know why but I can't find a solution to this. I have 3
don't know better title for this, but here's my code. I have class user
Don't know if anyone can help me with this or if it's even possible.
Don't ask me how but I'm in a situation where I have DCPs published

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.