Jump to content

PHP Yahoo Answers Clone Script Problem

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
thekooliest

thekooliest

    Newbie

  • Members
  • Pip
  • 2 posts
The site I am working on for myself is answersforpilots[dot]com. I don't have any graphics, I am just trying to get the main frame working. Right now I also just have a place to enter questions and view them. I took some of this code from a free script, and am a PHP noob, so I am not sure of how to fix my problem, but I know what it wrong. When you are on the home screen and try to view a Question by clicking on it, for example: "Question #1"...And it will bring you to a page that says "Question:" and "Answer:". The code for that section is:
<strong>Title: </strong><?php echo $rsQuestion[0]->title;?><br />

<strong>Question: </strong><?php echo $rsQuestion[0]->question_text;?>
The [0] denotes the most recent question, so even if I am viewing "Question #1", it will show "Question #2". Understand?
I can change that to [1] and get the information from the second most recent question asked, "Question #1"...but I've tried a lot and have not been able to show the information for the current question. If you could please help me with this, and if you need any more code you can look on my site, or just ask.
Thanks,
Sam.

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
The [] ([0], [1], etc) denotes an array. You have an array of objects, it looks like. Without seeing more code, I cannot help you but you need someway of identifying/connecting the current question to the current question in the array.

#3
thekooliest

thekooliest

    Newbie

  • Members
  • Pip
  • 2 posts
Ya I got it, thanks.