Welcome Guest, Not a member yet? Register   Sign In
Profile pictures?
#1

[eluser]Tom Taila[/eluser]
Hey, ive been reading up on file uploading and the image manipulation class, but i was wondering, how do i assign pictures to certain users, this is one of those things i hav never tried before and im completely clueless so sorry if im asking for much, but a brief overview of how it would work would really help me a lot! :S
lets say for example i want the users to have their own image gallery which can be accessed by theyre profile page, how would i assign it to that profile page? (if that makes sense).
i mean i know how to let a user upload the image, but what makes that image part of the users image gallery. I guess another way of putting it is "how can i link the user to the files they upload?" . im very sorry if im not wording this correctly but if any1 could help it would be much appreciated, cheers
#2

[eluser]falkencreative[/eluser]
I'm sure there are different ways to approach this... One way:

-- In your users table in the database, each user should have a unique ID (primary key, auto-increment)
-- You could have an images table in the database that could contain the image ID (primary key, auto-increment), the related user ID (so you know which user the image it relates to) and the url to the uploaded image

If you needed to get all the images associated with a specific user, you could search the images table and show all the images that have the correct associated user id.

If users have multiple galleries that you need to keep organized, you might also need a galleries table, and then need a column in your images database that included the id # of the gallery the image was a part of.
#3

[eluser]Tom Taila[/eluser]
hmm sounds simple enough, thanks so much bro Smile




Theme © iAndrew 2016 - Forum software by © MyBB