Hi all, I have a multidimesional array that holds consultants and their details. I've tried this a number of ways but to no avail. Could someone help me out iterating through the first and then the second array and display those results on my webpage. I messed it up pretty badly :( heh
Here's my code : Thx Joe :) // fetch the data from the database while(odbc_fetch_row($resultset)){ $consultantdetailsarray[0] = odbc_result($resultset, 1); $consultantdetailsarray[1] = odbc_result($resultset, 2); $consultantdetailsarray[2] = odbc_result($resultset, 3); $consultantdetailsarray[3] = odbc_result($resultset, 4); $consultantdetailsarray[4] = odbc_result($resultset, 5); $consultantdetailsarray[5] = odbc_result($resultset, 6); $consultantdetailsarray[6] = odbc_result($resultset, 7); $consultantdetailsarray[7] = odbc_result($resultset, 8); file://dump each consultant into the new array called $consultantarray $consultantarray[$x] = $consultantdetailsarray; $x++; } file://loop through the elements of retrieved array (2nd one holding the consultant details) for($y = 0; $y < count($consultantarray); +){ for($z = 0; $z < count($consultantdetailsarray[$y][$x]); $z++){ list($consultantid, $firstname, $lastname, $city, $stateprovince, $country, $category, $yearsexp) = $consultantdetailsarray; print "<tr><td align=left><font color='#663399' face='verdana' size=2><a href='consultantdetails.php?cid=" . $cid . "'>" . $firstname . " " . $lastname . "</a></font></td><td align=left><font color='#663399' face='verdana' size=2>" . $city . "</font></td><td align=left><font color='#663399' face='verdana' size=2>" . $stateprovince . "</font></td><td align=left><font color='#663399' face='verdana' size=2>" . $country . "</font></td><td align=left><font color='#663399' face='verdana' size=2>" . $category . "</font></td><td align=left><font color='#663399' face='verdana' size=2>" . $yearsexp . "</font></td></tr>"; } } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]