Jump to content

Recommended Posts

Hi,

 

I am multimedia student with only very beginner knowledge of php.

I am creating a wedding photographer site which has a client login page for clients to view their proofs and order by email.

 

I have created the mysql database but am unsure how to tackle the php for this - after the client logs in, having their specific photos pulled from the database and displayed to view and order.

My prof told me that I can have photos from all clients in one folder and have php rename them to that client and then retrieve the correct photos based on the id...but I have no clue on how to actually do this.

 

If anyone is able to point me in the right direction it would be greatly appreciated!!!

 

 

Link to comment
https://forums.phpfreaks.com/topic/155397-php-help-client-proof-gallery/
Share on other sites

what i would do in this case (which btw is NOT what your professor said to do) Is make a table in your database with all the photos information, and a table with all the client information.

 

on the photo table, I would have a column with the clients username, or id or something like that to associate a photo with a client.

 

then when they want to view their photos you do something like

<?
$user = $_SESSION['Username'];//or however you want to get the username
$query = mysql_query("SELECT * FROM photo WHERE userid='$user'");
...
//process query etc.
?>

 

I hope that helps

Thanks for the reply!

I'm still a bit confused as coding is really not my thing, but I need to get this done.

 

I have a tbl_clients that includes the fields: id, fname, lname,date,details,thumb,image,clientuser,clientpass

 

So you are saying the thumb and image fields should be in their own table? (Would I still be keeping all images in one folder or seperate folders per client...does it matter?)

The code you provided that would be included in my login.php script?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.