I have problem in my task, please help me:
Array :
$myPath[$i] = {1,2,5,6,7}
database hub:
id from to Path length
a 1 2 kapten tendean 1.2
b 2 5 majapahit 5.4
c 5 6 kyai maja 1.3
d 6 7 jendr.sudirman 2,1
I want my output like :
Kapten Tendean -majapahit-kyai maja-jendr.sudirman
In my php code like that:
$value1 = current($myPath[$i]);
$value2 = next($myPath[$i]);
$query3 = mysql_query("SELECT Path from hub where
from = $value1 and to = $value2") or die (mysql_error());
{
while($row3 = mysql_fetch_row($query3))
{
$jalan[$row] = $row3[0];
$foo2 .= sprintf("(%s)\n",
$jalan[$row]);
}
return $foo2;
and the result will give me only:
Kapten Tendean
I confuse in looping array in linked list php, please give me solution..Thanks before