Page 1 of 1
Question/Awnser Project...PHP/MYSQL
Posted: Tue Apr 18, 2006 11:53 pm
by anolan
Hello everyone,
I'm somewhat new to php and mysql but I can hold my own. I've been asked to a project for a friend, he's not paying me or anything but he thought it would be a fun thing to do and I was thinking about how to go about doing it...
Someone would ask a question and it'd be stored in a database. He'd then go to a page and see the questions, he would then proceed to choose the questions he'd like to awnser (that are in the database) he would then reply to them, and the ones he chose would be displayed on another page with the original question and his reply.
I guess that would kind of be like a forum, but he only chooses to reply to the ones he wants and only the ones he wants would be displayed. Can anyone kind of lead me into the right direction of doing this?
Thanks
Posted: Wed Apr 19, 2006 12:36 am
by feyd
A journey of a thousand miles begins with a single step.
What do you have? What do you need help with? (be specific please)
Posted: Wed Apr 19, 2006 12:50 am
by anolan
Wise words,
I've made a way so that people can send in the data and then the data be viewed on a different page. What I need help is, how do I make it so that my friend can choose from that data what he wants to be displayed on the other page, and also a way for him to reply to a single question, also, how could I have it so that the quetions he choose get rightly matched with the right response, because from the php and mysql that page I speak of that shows the data simply shows all the data in the column, my friend must pick and choose what he wants to respond to... now that I think about it I think it would be of benefit to show my ideas for the pages...
ask.php (would be where the people would ask their questions)
process.php (a php script to tell the question to go to the database)
display.php ( a page where my friend could view the questions)
respond.php ( a page where my friend would choose the questions he likes and then type his reply)
process2.php (a php script to tell my friend's question to get in the database)
home.php (a page where the questions he chose are displayed and matched with their appropriate response)
Hope this all helps
Posted: Wed Apr 19, 2006 1:10 am
by feyd
Okay. So for the time being, ignore the database element. Hard code into an array or something a couple questions. Each question will have a unique number associated with them. Use that to your advantage by passing that to the answering page using, say a checkbox.
Once you get the data passing to the answering page, redisplay the question and add a <textarea> afterward (or before, whatever you like.) Now get this page submitting to another pseudo database insertion page. Once you get that all working, you can add database hooking.
Posted: Wed Apr 19, 2006 1:13 am
by anolan
Yea exactly, but how do you assign numbers to indivual questions?
Posted: Wed Apr 19, 2006 1:14 am
by anolan
and of course eventually I'll need a page that displays the question and the reply to the public, I think you added that in your summary but just to be sure...
Posted: Wed Apr 19, 2006 1:17 am
by feyd
Once set up correctly, the database's table will automatically generate the unique number for the questions. So for this first step, you can number them however you like so long as they are unique.
Posted: Wed Apr 19, 2006 1:24 am
by anolan
so your saying that the database will take care of the numbering and I just need to do some php to call upon using this numbering? Sounds good, so where should I start?
Posted: Wed Apr 19, 2006 1:32 am
by feyd
I already told you where to start.

Posted: Wed Apr 19, 2006 2:28 am
by Chris Corbyn
anolan wrote:so your saying that the database will take care of the numbering and I just need to do some php to call upon using this numbering? Sounds good, so where should I start?
The database can auto-increment a number for you each time a question is added. There are other ways to do it but there's really no point in looking at them until you have some basics down

Posted: Wed Apr 19, 2006 11:56 am
by anolan
alright guys I'll start working on that and I'll let you know if I run into trouble, thanks