dear members,
i think i have problem in declaring multi dimensional array and then retrieving it in other form or control.
here is the case, i have grid application (not a form). in the onrecord event, i simply type this code:
$arr1=[i];
[arr_v1][$arr1][‘HotelID’]={HotelID};
[arr_v1][$arr1][‘LogoHotel’]={LogoHotel};
[arr_v1][$arr1][‘Foto1’]={Foto1};
[arr_v1][$arr1][‘Hotel’]={Hotel};
[arr_v1][$arr1][‘Alamat’]={Alamat};
[arr_v1][$arr1][‘Kota’]={Kota};
[arr_v1][$arr1][‘Telp’]={Telp};
[arr_v1][$arr1][‘Fax’]={Fax};
[arr_v1][$arr1][‘Email’]={Email};
[arr_v1][$arr1][‘Latitude’]={Latitude};
[arr_v1][$arr1][‘Longitude’]={Longitude};
[arr_v1][$arr1][‘BriefDesc’]={BriefDesc};
[i]++;
no error found. the grid works properly. when i hit the button (yes, i add button as link, and then pass the [arr_v1] as the global variable), it goes to the blank application which should get the passed variable.
here is the code i type in the blank application (the target).
$Isi=[i];
$arrx=array();
$arrx=[arr_v1];
//retrieving all value from array which passed from the grid application
for ($x=0; $x<=$Isi; $x++){
//terpaksa dibongkar array di sini
$Lat=$arrx[$x][‘Latitude’];
$Longitude=$arrx[$x][‘Longitude’];
$Hotel=$arrx[$x][‘Hotel’];
$Alamat=$arrx[$x][‘Alamat’];
}
i got error message:
Fatal error: Cannot use string offset as an array in E:\Scriptcase\wwwroot\scriptcase\app\Simba\blank_MapHotelList\blank_MapHotelList.php on line 953
here is the code i copy from the generated php (line 951 to 963, error highlighted on line 953)
for ($x=0; $x<=$Isi; $x++){
$Lat=$arrx[$x]['Latitude']; //this is line 953
$Longitude=$arrx[$x]['Longitude'];
$Hotel=$arrx[$x]['Hotel'];
$Alamat=$arrx[$x]['Alamat'];
}
are there any missing part or i did a mistake in the blank application? (the target which receives the array variable)
please kindly help for this case since i don’t have any idea which part i did the mistake. my best guess is in the blank application because the error was raised here.
thanks