Ok mybe that one has stumped us guys so i'll give you the whole code and see if you can come up with a way to add a </TR> to the end of evey two rows that are taken from the database.
<?php
include("vars.php");
$connection = mysql_connect($db_host, $db_username, $db_password) or die("Unable to connect to database");
@mysql_select_db($db_name, $connection) or die("Unable to select database $db_name");
// Check that the values of minval and maxval are numeric
// Alter the 1, 15 to the min and max number of digits minval and maxval are allowed to have
if ((!ereg("^[0-9,]{1,20}$", $_GET['minval'])) ||
(!ereg("^[0-9,]{1,15}$", $_GET['maxval'])))
{
echo "Invalid input data";
exit;
}
$sqlquery = "SELECT * FROM properties WHERE country = '$country' AND ((price >= $_GET[minval]) AND (price <= $_GET[maxval]))";
$result = mysql_query($sqlquery, $connection);
$num = mysql_num_rows($result);
for ($i=0; $i<mysql_num_rows($result); $i++; $row = mysql_fetch_assoc($result); )
echo "\n<td><a href=\"property.php?country=&id=".$row["id"] ."\"><img src=\"".$row["thumbnail"] ."\"></a><br>Location: ". $row["location"]. "<br>Price: ". $row["currency"]. "". $row["price"]. "</td> ";
if (($i % 2) == 1) echo "</tr>\n<tr>";
}
// Close table row if odd number of rows
if (($num % 2) == 1) echo '</tr>';
mysql_free_result($result);
?>