![]() |
[php] multi-dimensional arrays, and you!
I'm working on a photo-gallery-like project right now, and am running into some issues manipulating a multi-dimensional array. First, here's the info that I'm working with:
PHP Code:
The sql wrapper that I use returns an array of an array as the results ( $results[0-254]['column_name'] ), and what I'm currently attempting to do is to select each row, and push each row into a "rows" array, like so: PHP Code:
PHP Code:
|
Yeah, it was simple.. The inner for loop was messed up :P
It was: for ( $w=0; $x < $positions; $w++ ) { It needed to be: for ( $w=0; $w < $positions; $w++ ) { |
glad I could help!! ... errr... j/k, hehe.
|
heh, hate it when that happens. as good as a 100 line method to get a value out of a file. and it worked. only I forgot to set it into the member value. so when i accessed it, i got a big fat NULL! ;)
|
I've done the same once where I had 6 seperate if/else if statements and instead of using '==' to check their value, I had put '=' by accident. Three hours and numerous outbursts later, I finally saw the mistake and fell on my floor laughing...
|
All times are GMT -8. The time now is 02:50 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project