E-roads index

[insert_php]

$connection = mysql_connect(“localhost”,”mijnlieff_elbruz”,”c4MOyRfj”) or die (“Couldn’t connect to the database”);
$db = mysql_select_db(“mijnlieff_elbruz”) or die (“Couldn’t select database”);

if (isset($_REQUEST[‘id’]))
{
echo “

“. $_REQUEST[‘id’] . “

“;

$sql = “SELECT *
FROM `eroads`
WHERE `Road` LIKE ‘{$_REQUEST[‘id’]}’
ORDER BY Sequence”;
$sql_result = mysql_query($sql,$connection) or die (“Couldn’t execute query”);

echo “

“;
echo “

“;
while ($node = mysql_fetch_array($sql_result))
{
echo “

“;
echo “

“;
echo “

“;
}
echo “

Country City Connection
{$node[‘Country’]} {$node[‘City’]} {$node[‘Connect’]}

“;
}
else
{
echo “

North-south reference road

“;

$sql = “SELECT distinct Road, convert(substr(Road,2), unsigned integer) as i FROM `eroads` WHERE `Roadtype` LIKE ‘NS-REF’ORDER BY i”;
$sql_result = mysql_query($sql,$connection) or die (“Couldn’t execute query”);
while ($road = mysql_fetch_array($sql_result))
{

echo “{$road[‘Road’]}” . ” “;
}

echo “
“;
echo “

West-east reference road

“;
$sql = “SELECT distinct Road, convert(substr(Road,2), unsigned integer) as i FROM `eroads` WHERE `Roadtype` LIKE ‘WE-REF’ORDER BY i”;
$sql_result = mysql_query($sql,$connection) or die (“Couldn’t execute query”);
while ($road = mysql_fetch_array($sql_result))
{

echo “{$road[‘Road’]}” . ” “;
}

echo “
“;
echo “

North-south intermediate road

“;
$sql = “SELECT distinct Road, convert(substr(Road,2), unsigned integer) as i FROM `eroads` WHERE `Roadtype` LIKE ‘NS-INTER’ORDER BY i”;
$sql_result = mysql_query($sql,$connection) or die (“Couldn’t execute query”);
while ($road = mysql_fetch_array($sql_result))
{

echo “{$road[‘Road’]}” . ” “;
}

echo “
“;
echo “

West-east intermediate road

“;
$sql = “SELECT distinct Road, convert(substr(Road,2), unsigned integer) as i FROM `eroads` WHERE `Roadtype` LIKE ‘WE-INTER’ORDER BY i”;
$sql_result = mysql_query($sql,$connection) or die (“Couldn’t execute query”);
while ($road = mysql_fetch_array($sql_result))
{

echo “{$road[‘Road’]}” . ” “;
}

echo “
“;
echo “

Branch, link or connecting road

“;
$sql = “SELECT distinct Road, convert(substr(Road,2), unsigned integer) as i FROM `eroads` WHERE `Roadtype` LIKE ‘B-L-C’ORDER BY i”;
$sql_result = mysql_query($sql,$connection) or die (“Couldn’t execute query”);
while ($road = mysql_fetch_array($sql_result))
{

echo “{$road[‘Road’]}” . ” “;
}

}
[/insert_php]