for loop on a record set

sc_lookup(rs, $check_sql);

if (!empty({rs}))
{
$datasetCount = count({rs}); // returns count of array items of any array
echo “<h1>There are $datasetCount Rows</h1>”;
$i = 0;

// trying to loop throught the multidementional array

for($i=0; i &lt; $datasetCount; i++)
{
	for($j=0; j &lt; $datasetCount[i]; j++)
	{
		
		   echo {rs}[i][j];
	
	}
}

}
i want to be able to access the two values in each array.
instead am getting input boxes to enter values for i & j.
the values are to be manipulated.
the structure of the array is like this:
[2,4]
[5,6]

i need to put 2 & 4 into separate variables

echo {rs}[i][j];

Try
echo {rs}[$i][$j];

Because you have forgotten to add the $ and now I and j are considered to be global variables.

for($i=0; i < $datasetCount; i++)
{
for($j=0; j < $datasetCount[i]; j++)
{

echo {rs}[i][j];

should be

for($i=0; i < $datasetCount; $i++)
{
for($j=0; j < $datasetCount[i]; $j++)
{

echo {rs}[$i][$j];

[QUOTE=aducom;30806]Because you have forgotten to add the $ and now I and j are considered to be global variables.
should be

for($i=0; i < $datasetCount; $i++)
{
for($j=0; j < $datasetCount[i]; $j++)
{

echo {rs}[$i][$j];[/QUOTE]

and for($j=0; j < $datasetCount[i]; $j++) should be for($j=0; j < $datasetCount[$i]; $j++) too