Hello,
I am little bit comfused with the array output of the SELECT using PHP.
My Select statement should return 3 different records from ONE field of a table.
i am trying two methods to display the result
$test = $result3->num_rows;
for($i = 0; $i < $test; $i++)
{
$row3 = $result3->fetch_assoc();
echo $row3['dt'];
echo '<br>';
}
the for loop returns the three records i want but the problem is that if i do count() is just returns value: 1 because i guess it counts only the DT field...I need to compare the returned values and then put them on another table. But dont know how to do it
and the second is with the while
$i=0;
while($i < $total_cols3)
{
sort($row3);
echo $row3[$i];
echo '<br>';
$i++;
}
while($row3 = mysqli_fetch_row ($result3))
{
$j = 0;
while($j < $total_cols3)
{
sort($row3);
echo $row3[$j];
echo '<br>';
$j++;
}
}
here the count returns 3 and then displays the values but dont know how to make comparisons after that
thank you