All pictures, normal or faded, depeding on answer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lleoun
Forum Newbie
Posts: 8
Joined: Mon Feb 25, 2008 5:37 am

All pictures, normal or faded, depeding on answer

Post 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.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

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

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
lleoun
Forum Newbie
Posts: 8
Joined: Mon Feb 25, 2008 5:37 am

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

Post 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!
Post Reply