Jump to content

Multidemensional arrays?


madmenyo

Recommended Posts

Hi there.

 

In my database table i have multiple records with multiple values that need to be fetched into an array. I think i need to do this as a multidimensional array but i'm not sure how. I can also put each record into a sepperate array but then i'm not sure how to increase the arrays name within the while loop. Hers an example:

 

while ($recruits = mysql_fetch_assoc($recruitsquery))
{
$recruit1 = array(name => $recruits['name'], health => $recruits['health'], damage => $recruits['damage']
}

 

So how would i change $recruit1 in the next loop to $recruit2? Or how would i build a multidimensional array?

Link to comment
https://forums.phpfreaks.com/topic/214183-multidemensional-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.