Jump to content

How do I create this real estate listing page?


noelde

Recommended Posts

This should be doable, right?

 

I have a mysql table (‘tb_content’) that has a record for each real estate property listing

 

A web page (‘properties.php’) renders data (property details) that are stored in the table tb_content for one of the listings (‘123 xyz Street’).  The query that pulls the page content from the mysql table for the properties.php page is something to the effect of (please excuse the butchering…the code is conceptual)

 

If (isset($_SESSION[‘recordid’])) {

$recordid=$_SESSION[‘recordid’];

$sql=SELECT * FROM tb_content WHERE prop_id=$recordid;

And so on…

} else {

//this is the default property

$sql=SELECT * FROM tb_content WHERE featuredproperty=’-1’;

While…mysql_fetch_array()

$recordid = $row[‘prop_id’];

$_SESSION[‘recordid’]= $recordid;

And so on.

}

On properties.php, there is a small section that lists a series of hrefs that represent the rest of the addresses for the other records in tb_content (‘109 Lowe Street’ ‘456 xyz Street’ ‘123 abc Street’ etc…..)

 

Shouldn’t there be a way to have the user click on any one of the hrefs, have the associated prop_id (field name in the table tb_content)  would replace the value in $_SESSION[‘recordid’], the page properties.php would re-render, but with the new desired property details?

 

I’ve been failing miserably with everything I’ve tried.

 

I could really use some help.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.