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 multidimensional array not printing right

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-20-2006, 05:27 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Crusader's Avatar
Join Date: Aug 2003
Location: Canada
Posts: 1,257
Crusader is just really niceCrusader is just really niceCrusader is just really niceCrusader is just really nice
 



multidimensional array not printing right


Code:
if($owner[$i]!=NULL){
	//print 'yes';
	if($report!=NULL){
		if($report[0]['sector']!=$location[$i]){
			print $report[0]['sector'];
			$report=NULL;
		} else {
			$report[]=array("sector"=>$location[$i],"owner"=>$owner[$i],"ship"=>$ship[$i],"mothership"=>$mothership[$i],"name"=>$name[$i]);
		}
	} else {
		$report=array();
		$report[]=array("sector"=>$location[$i],"owner"=>$owner[$i],"ship"=>$ship[$i],"mothership"=>$mothership[$i],"name"=>$name[$i]);
	}
}
I don't know why but when there are 2 arrays or more it will only print the results for the second array. Can anyone see anything wrong with my code?
????: NamePros.com http://www.namepros.com/programming/271478-multidimensional-array-not-printing-right.html

Thanks.
Crusader is offline  
Old 01-01-2007, 06:29 AM   #2 (permalink)
Account Closed
 
klavixs's Avatar
Join Date: Aug 2006
Location: Under a Bridge
Posts: 200
klavixs will become famous soon enoughklavixs will become famous soon enough
 



hmmm


all i can tell this is doing is adding an array to the variable report which is just a variable.if theres more please show but if you want $report to print to screen try this at the end of the script
PHP Code:
reset($report);//this basicly rewinds an array position to the beginning
print_r($report);//this prints an arry 
????: NamePros.com http://www.namepros.com/showthread.php?t=271478
(any mistakes in my syntax let me know)

Thats all i can say unless there is more

Peace
.:klavixs:.
klavixs is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:06 AM.

Managed Web Hosting by Liquid Web
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