I have this table in mysql, table "distance":
id | distance | 1 | 8 | 2 | 5 | 3 | 7 |
I want output such as:
8 5 7 8 5 7 8 5 7
How do I code it in php? Thanks, I'm a newbie in PHP.
I have this table in mysql, table "distance":
id | distance | 1 | 8 | 2 | 5 | 3 | 7 |
I want output such as:
8 5 7 8 5 7 8 5 7
How do I code it in php? Thanks, I'm a newbie in PHP.
try like this
$tableRows[0]=array("id"=>1,"distance"=>8);
$tableRows[1]=array("id"=>2,"distance"=>5);
$tableRows[2]=array("id"=>3,"distance"=>7);
$counter=0;
foreach($tableRows as $tableRow)
{
foreach($tableRows as $tableRow)
{
echo $tableRow["distance"]."\t";
}
echo "\n";
}