0

Hi there,

I am facing problem in coding PHP for my search results, my search results produce dynamic URLs (clickable texts) but when i click on the url's no results.
In my website am trying to display all hotels in a city, and Iam searching with the hotel name and location. The search result displays resullts in a list (hotel name and location) and are clickable. when i click on the links a new page should open showing details of the hotel such as name, location, address, phone number etc.

please help me with the code as am a php no voice.

4
Contributors
10
Replies
11
Views
5 Years
Discussion Span
Last Post by ramganesht
0

please help me with the code as am a php no voice.

What code? You haven't posted any. Show your code.

0

Please complete your details so that we can know what specific problem that you having for.

0
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!

<?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>";
        }

?>
0

well all i can see so far is that when you click on the link, you get a url that only has 1 variable.

post.php?id=1hoteljoes

try

<a href=\"post.php?id=".$arr['id']."&type=".$arr['type']."&name=".$arr['name']."\">
0

Hi fobos,
that works fine, my question was when I click on the URL no result is being displayed.
please help me in that way.

Edited by ramganesht: spelling mistake

0

well then you need to post the code for the other page. why post a code if you didnt have a problem with it

0

When I click on the page also only the link is displayed in the resulting page.

Edited by ramganesht: spelling mistake

0

the dynamic links are displayed correctly but when i click on a link all the links are displayed instead of the row data of that particular link(id). please help me

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.