cliftonbazaar Posted January 15, 2010 Share Posted January 15, 2010 I wanted a 2 dimensional array of information for a game I was building but found out on the Internet that it could not be 'imploded' into a database. So i made 12 arrays, one for each player, instead of a team array $team[12][31]. Now when I goto explode it I thought I would go through a loop //for($line_up=1; $line_up < 12; $line_up++) { $playerArray.$line_up = explode(",", $match[$homeTeam.$line_up]); //Get the player from the database } the loop breaks as soon as it completes the first explode. I found out this the easy way by putting echo "$line_up"; in the loop and it only showed up once when run; comment out the explode line and the echo $line_up shows 1-12 (as it should). Is there any way around this or a better way? Quote Link to comment Share on other sites More sharing options...
trq Posted January 15, 2010 Share Posted January 15, 2010 Storing arrays within a database wreaks of poor design, I would start by fixing that. Explain what data you need to store and we might be able to helk you with a better design. Quote Link to comment Share on other sites More sharing options...
cliftonbazaar Posted January 16, 2010 Author Share Posted January 16, 2010 Explain what data you need to store and we might be able to help you with a better design. Each team has about 35 statistics and anywhere from 16-25 players; each player has 31 statistics. My design currently is to have each player as an array of their own stats. If someone can help me with the explode loop problem that would allow me to keep going in this area; if another design concept is suggested then i would welcome it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.