Page 1 of 1

All pictures, normal or faded, depeding on answer

Posted: Wed Mar 26, 2008 12:53 pm
by lleoun
Dear people,

My friends are recording videos and uploading them into my webpage. They are answering with these videos questions that I am asking to them. The video itself goes to a folder and its name, type, size, path, keyword and number go to a MySql table called videos.

In the videos table, the name of the video is a keyword and a number all together plus its extension. The number is the same one as the id_friend in the friend’s table. And the keyword is the keyword for the question. If I am asking about their favourite band, the keyword will be ‘band’.

In the friends table I have my friends' name and two pictures of them. A normal one (pic_friend) and a faded one (pic_friend_fade).

What I want to do is to create a page for each question so I can show their video-answers.
Then in the question page I want to show all their pictures. The normal picture and the link to a page with the video if there's a video-answer from them, and a faded picture and no link if there's no video-answer from them.

I've been trying for a long time and I'm going mad. I can do the link to the page with the video, but I cannot do the pictures thing for each question .. please help!
Thanks a million in advance!!

Here are the two tables:

Code: Select all

 CREATE TABLE friends (id INT NOT NULL AUTO_INCREMENT,id_friend INT NOT NULL,name VARCHAR(30) NOT NULL,pic_friend VARCHAR(255) NOT NULL,pic_friend_fade VARCHAR(255) NOT NULL,PRIMARY KEY(id));  CREATE TABLE videos (id INT NOT NULL AUTO_INCREMENT,name VARCHAR(30) NOT NULL,type VARCHAR(30) NOT NULL,size INT NOT NULL,path VARCHAR(60) NOT NULL,keyword VARCHAR(30) NOT NULL,number INT NOT NULL,PRIMARY KEY(id)); 
edit: added mysql tags.

Re: All pictures, normal or faded, depeding on answer

Posted: Wed Mar 26, 2008 4:27 pm
by pickle
So, you're just having trouble displaying the image? Its path is stored there in your DB - just put the path in an <img> tag.

Thanks for adding mysql tags - makes things MUCH easier to read.

Re: All pictures, normal or faded, depeding on answer

Posted: Wed Mar 26, 2008 5:54 pm
by lleoun
Thanks for answering pickle. But it's not a problem about displaying the images.

Let me explain it again:

I have videos-answer from my friends for several questions.
I want to have all my friend's pictures in the page of each question. If they have answered (which means if they have uploaded a video-answer), I want to show a normal picture but if they have not answered yet to the question I want to show a faded picture.

As I say displaying an image is not a problem, the issue is to show all my friends in each question page, making the difference if they have answered or not the question with one picture or another.

Thanks once again!