Jump to content

finding a row a database


marquis

Recommended Posts

$con = mysql_connect("localhost","root","*******");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("realestate", $con);$result = mysql_query($SQL);while($row = mysql_fetch_array($result)) { echo '<center>'; echo '<a href="descrip.php">'; echo '<img src="images/'. $row['imagename'] .'" width="400"height="400">'; echo '</center>'; echo '<br>'; echo '<br>'; echo "<table border='5'bgcolor='#ff8080'> <tr> <th>Address</th> <th>Price</th> <th>Baths</th> <th>Bedrooms</th> <th>State</th> <th>City</th> <th>Square Feet</th> <th>County</th> <th>Year Built</th> <th>Buy or Lease</th> </tr>"; echo "<tr>"; echo "<td>" . $row['address'] . "</td>"; echo "<td>" . $row['price'] . "</td>"; echo "<td>" . $row['baths'] . "</td>"; echo "<td>" . $row['bedrooms'] . "</td>"; echo "<td>" . $row['state'] . "</td>"; echo "<td>" . $row['city'] . "</td>"; echo "<td>" . $row['squarefeet'] . "</td>"; echo "<td>" . $row['county'] . "</td>"; echo "<td>" . $row['yearbuilt'] . "</td>"; echo "<td>" . $row['buyorlease'] . "</td>"; echo "</tr>"; echo "</table>"; echo "<br>"; echo "<br>"; }if(mysql_num_rows($result) == 0)ECHO "<h3>NO MATCHES FOUND</h3>";mysql_close($con);?>this out puts tables and a pic link for how ever many search results where found what im trying to to is have it to where when you click on the pic it take you to a new page that has a detailed description of the house. the problem is im not sure how to pick the row out of the table that corresponds to the pic that you clicked on.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...