I am, trying to write a PHP-Mysql code which fetches the important places in a city and displays the results as links, when i click on the city it should display all the details like name, place, address, phone number etc, but in this case results are not being shown.
this is my code, table name is table1, the results(links) are being displayed on my home page, but when i click on the links details are not being displayed, please help!
Am fetching data from database and the results are created as URL's dynamically but when i click on the URLs no data is being shown.
<?php
include ('connectdb.php');
$query = "SELECT type, name, location, landmark FROM table1";
$result = @mysql_query($query);
echo mysql_error();
if ($result) {
while($arr = mysql_fetch_array($result, MYSQL_ASSOC)){
$resultlink = "\n\t<li><a href=\"posts.php?ID={$arr['id']}+{$arr['type']}+{$arr['name']}\">{$arr['name']} {$arr['location']}</a></li>";
$end_result .= '<li>' . $resultlink . '</li>';
$resultlink .= "
\n<p>Name: {$arr['name']}</p>
\n<p>Type: {$arr['type']}</p>
\n<p>Location: {$arr['location']}</p>";
}
echo $end_result;
} else {
echo "<p>Sorry no results for $word</p>";
}
?>