while and arrays

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

while and arrays

Post by Jose Arce »

How can i convert the results of a while to array???
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

Code: Select all

$arr = array();
while($row = mysql_fetch_assoc($r)){
    $arrї] = $row;
}
Cheers Sam
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

Post by Jose Arce »

wow that was fast..thx sam but i'm not using a database i'm using something like this:

while (++$i <= 10) {


hope its enough for you to understand...:D
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

Same principal... Just doump the results of whatever your working on into an array...

Cheers Sam
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

Post by Jose Arce »

again...super fast sam...thx a lot!

i'll check this later...and i'll tell ya what happend...


THX! :D
Post Reply