By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,722 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,722 IT Pros & Developers. It's quick & easy.

Php MySql dynamic table populate

P: 1
Greetings, I'm a Php newbie and am developing a photo album site and have the basic framework in place with user registration, login, and then a page that you can upload images to MySql and those images are displayed below. What I am trying to do is create a system whereby when a user logs in they are sent to a page that shows a table with THEIR images that they have uploaded.. kinda creating the users very own page. I'm sure this is possible but am stumped. Please help if you can : )
Jan 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: 12
its only a photo site? so nothing else? you might want to upload the images and save the url to the image in the mysql db.. ive got a script for this,..

Hope to hear from you
Greets, BeRtjh
Jan 18 '07 #2

ronverdonk
Expert 2.5K+
P: 4,258
BeRtjh: a url makes no sense because all images are stored in the MySQL database (if I read the problem description correctly).

When 1 image is strictly tagged to 1 user, you can do the following. At the time the user uploads the image, I may assume he can do that after having been validated via a login. So you have the user's name available at upload time. You can then store the username in the same table same row as the image.

At display time you then select all images belonging to that (also validated logged-in) username using the following statement (var $username holds the validated user's name):
Expand|Select|Wrap|Line Numbers
  1. SELECT image_name FROM image_table WHERE userid='$userid';
Ronald :cool:
Jan 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.