Can anyone help?
I have a problem in replacing strings that have been passed through a function and then echoed.
The data is pulled in from a Filemaker table as 'Node Codes' i.e. GHH, JHY, KJI
These are then processed by an algorithm and all works fine.
However when the results are echoed I do not want the Node Codes but the associated Street Names which are stored in another table:
Ref StreetName
VGF Via Gon Folio
I pull this data into an array ($Ref, StreetName), but when it comes to displaying the info i need some sort of way of checking the Node Code, determine its Street Name and display this instead.
At the moment the code that 'pulls' the tables looks like this:
while( odbc_fetch_row( $cur ) ) {
$street = odbc_result($cur, 1);
$link = odbc_result($cur, 2);
$link_num = odbc_result($cur, 3);
$neighbors[$street][$link] = $link_num;
} -- Pulls in the Node Codes and their values for the algorithm to work on
while( odbc_fetch_row( $cur2 ) ) {
$Ref = odbc_result($cur2, 1);
$Street = odbc_result($cur2, 2);
$array = array($Refs, $Streets);
-- Pulls in the Street Names and their according Node Code references
$paths = dijkstra($neighbors, "$FromPoint");
while(list($vertex, $path) = each($paths))
if ($vertex=="$ToPoint") {
?><?echo "Going From Point: <BR><BR> $FromPoint <BR><BR> to <BR><BR> $vertex <BR><BR>";
for ($t=1;$t<count($path);$t++){
echo ("Via Point $path[$t] <BR>");
};
echo ("<BR>At a distance of $path[0] <BR>");
}; -- Prints the results (Node Codes) onto screen
Can anyone help, i stuck and this is a university project that has to be in next week!!
Thanks for looking
James