Forum Moderators: coopster

Message Too Old, No Replies

need help converting this to php

multilevel arrays in php?

         

blakebinkley

5:21 pm on May 6, 2005 (gmt 0)

10+ Year Member


I have this piece of Perl Code

while(($mn,$mp,$sn,$ma) = $moves->fetchrow_array) {
$mv[$mn -1]->[$sn -1] = $mp . '¦'. $ma;
}

and wrote this but it's not exactly right:

while(list($mn,$mp,$sn,$ma) = mysql_fetch_row($moveresult)) {
$lmn =$mn -1;
$lsn = $sn - 1;
$joined=$mp.'¦'. $ma;
$mv[$lmn]->$lsn = $joined;
}

any help would be greatly appreciated.

Blake Binkley

coopster

12:43 pm on May 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, blakebinkley.

You are assigning values to an object variable. Did you create a new object first?

blakebinkley

1:31 pm on May 10, 2005 (gmt 0)

10+ Year Member



yes, I am creating a new object each times

are you saying these 2 pieces of code are funtionally the same? if so then I'll know it's my query that is the problem.

Blake