Somebody please help

I’m creating a real estate website for my final year project. I have a page that displays search results using an array. This is how it looks.

[php]$result = mysql_query(“SELECT * FROM property”) or die(mysql_error());
while ($row = mysql_fetch_array($result)){
echo $row[‘short_description’].’’."";
echo ‘’.’’."";
echo ‘’;
echo ‘<img src="’.$row[‘picture1’].’’."";

}[/php]

The thing I want to do is allow the user to click on the short description and be taken to a page that shows the full description based on the link clicked. How can I do this. Please help me guys, I know it’s something simple but I’m really struggling with it.

Thanks in advance

hello use below code.

[php]

/*

Here substr function display only 50 character as short description. define your page URL where to redirect after clicking short description…

USE BELOW CODE
*/
$pageurl = ‘www.google.com’; //‘put url page url’
echo ‘’.substr($row[‘short_description’],0,50).’…’;

#instead of

echo $row[‘short_description’].’’."";

[/php]

reply your feedback

SR

Thanks you so much for you reply. Your advice will help me a lot but I don’t think I explained what I want to do properly. See how for the url you have used Google. I want to use a php page that will show results based on the row clicked. I need to pass the id onto the next page, I tried using

[php]$result = mysql_query(“SELECT * FROM property”) or die(mysql_error());
while ($row = mysql_fetch_array($result)){
echo $row[‘short_description’].’’."";
echo ‘’.’’."";
echo ‘’;
echo ‘<img src="’.$row[‘picture1’].’’."";
$_SESSION[‘id’] = $row[‘id’];
}[/php]

But the problem is that the session is always equals to the last row in the array. I’m sorry for my poor explaining but please help me. I can’t move on with my project at all and the worst part is I don’t even know what to search for to get help.

I’m all sorted now. What I needed to learn is how to pass variables through a url

Sponsor our Newsletter | Privacy Policy | Terms of Service