NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP Yahoo Answers Clone Script Problem

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 07-10-2009, 08:19 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Jan 2009
Posts: 181
thekooliest is on a distinguished road
 



PHP Yahoo Answers Clone Script Problem


The site I am working on for myself is Answers for Pilots. 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:
Code:
<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.
????: NamePros.com http://www.namepros.com/programming/595696-php-yahoo-answers-clone-script-problem.html
Thanks,
Sam.
Last edited by thekooliest; 07-10-2009 at 10:29 PM.
thekooliest is offline   Reply With Quote
Old 07-11-2009, 08:57 AM   #2 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



we'd probably need the name of the script you're using. if your problem is that changing [0] to [1] isn't giving you the data you want, it could be a problem with the script, or could be a problem with some edit you made (if you made any)
nasaboy007 is offline   Reply With Quote
Old 07-11-2009, 09:38 AM   #3 (permalink)
NamePros Regular
Join Date: Feb 2006
Posts: 526
psalzmann is just really nicepsalzmann is just really nicepsalzmann is just really nicepsalzmann is just really nice
 



print_r($rsQuestion);

Will give you the entire schema of that array. You can then figure out what you need from that.

To determine if [0] or [1] (array keys) exist and contains content, you need to do this:

PHP Code:
$title $question '';
if (isset(
$rsQuestion[0]) AND !empty($rsQuestion[0]))
{
    
$title $rsQuestion[0];
}
if (isset(
$rsQuestion[1]) AND !empty($rsQuestion[1]))
{
    
$question $rsQuestion[1];

Now you can $title and $question in your string without issue like this:
????: NamePros.com http://www.namepros.com/showthread.php?t=595696

<strong>Title: </strong><?php echo $title;?><br />
<strong>Question: </strong><?php echo $question;?>

__________________
ILance - Enterprise Auction Software : As Seen on CNN & Fox News - View Online Demo - PHP/MySQL - SEO ready | 100% Customizable!
psalzmann is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yahoo answers API script, unlimited domains, Just $14 ! eqqu Scripts For Sale 6 06-07-2008 11:14 AM
[FORSALE]250+ Professional PHP E-commerce mySQL Scripts steelbeam Scripts For Sale 6 07-23-2007 01:29 PM
Huge Xmas script pack sale $5.00 KPR Scripts For Sale 1 12-08-2005 06:25 PM

 
All times are GMT -7. The time now is 02:30 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger