Hi all i am new to using arrays in PHP use them a lot in flash actionscript and need a bit of help. Here is the code I am using at the moment. All works fin print_r(); outputs perfectly.
for($x=0;$x<$catamount;$x++){
$catarray[$x] = ${'catid'.$x};
}
$desc = "happy";
for($y=0;$y<$catamount;$y++){
$queryname = ${'query'.$y};
$searchid = $catarray[$y];
$row = ${'row'.$y};
$amtreturns = ${'amtreturns'.$y};
$queryname = @mysql_query("SELECT * FROM images WHERE CatId = '$searchid' AND ImageName LIKE 'happy'");
//or print("This is here".mysql_error());
$amtreturns = mysql_num_rows($queryname);
//print("the amount of returns for each expression = $amtreturns2");
for($z=0;$z<$amtreturns;$z++){
$row = mysql_fetch_assoc($queryname);
$imagedetails[0] = $row['ImageId'];
$imagedetails[1] = $row['ImageLink'];
$imagedetails[2] = $row['ImageName'];
//print_r($row);
$image[$z] = $imagedetails;
}
$catarray[$y] = $image;
}
//print("<br>");
//echo $catarray[0];
print_r($catarray) = the follwing
Array ( [0] => Array ( [0] => Array ( [0] => 379 [1] => makaton\series1\V.jpg [2] => happy ) ) [1] => Array ( [0] => Array ( [0] => 32 [1] => feelings\Happy clr 2.jpg [2] => Happy ) [1] => Array ( [0] => 33 [1] => feelings\Happy clr.jpg [2] => Happy ) ) )
What is the syntax to do the following
- find the length of an array ? ie catarray length is 2 and catarray[0][0] is 3 in my mind.
- ouput $catarry[1][0][0] which in my mind should be 32
need this to build an xml statment for use in a flash app
Thanks
Twcmad