Forum Moderators: coopster
if(mysql_num_rows($query) > 0){
//loop through the results
echo "<table border='1'>";
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array($query)) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "";
echo $row['id']."<br>";
echo "<tr><td>";
echo $row['owner']."<br>";
echo "<tr><td>";
echo $row['location']."<br>";
echo "<tr><td>";
echo $row['area']."<br>";
echo "<tr><td>";
echo $row['community']."<br>";
echo "<tr><td>";
echo $row['type']."<br>";
echo "<tr><td>";
echo $row['bedrooms']."<br>";
echo "<tr><td>";
echo "<br>";
echo "There are $row[0] results for your search";
}
}
echo '</table>';
echo '<div>There are $row[0] results for your search</div>';
//see if the query returned anything ie > 'more than' 0 rows
if(mysql_num_rows($query) > 0){
//loop through the results
echo "Search conducted on: ";
echo date("l, F d, T h:i" ,time());
echo "<p>";
echo "Here are the results of your search:";
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array($query)){
// Print out the contents of each row into a table
echo '<table>';
echo '<tr>';
echo '<td>' . "Villa ID: " . $row['id'] . '</td>';
echo '</tr>';
echo '<td>' . "Contact: " . $row['contact'] . '</td>';
echo '</tr>';
echo '<td>' . "Location: " . $row['location'] . '</td>';
echo '</tr>';
echo '<td>' . "Area: " . $row['area'] . '</td>';
echo '</tr>';
echo '<td>' . "Community: " . $row['community'] . '</td>';
echo '</tr>';
echo '<td>' . "Property Type: " . $row['type'] . '</td>';
echo '</tr>';
echo '<td>' . "Number of Bedrooms: " . $row['bedrooms'] . '</td>';
echo '</tr>';
echo '<br>';
echo '</table>';
}
//close while loop
echo '<div>There are $row[0] results for your search</div>';
if(mysql_num_rows($query) > 0){
//loop through the results
echo "Search conducted on: ";
echo date("l, F d, T h:i" ,time());
echo "<p>";
if(mysql_num_rows($query) = 1) {
echo '<div> ' . mysql_num_rows($query) . ' villa was found, here are your results:</div>';
}
else{
echo '<div> ' . mysql_num_rows($query) . ' villa(s) were found, here are your results:</div>';
}
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array($query)){
// Print out the contents of each row into a table
echo '<table>';
echo '<tr>';
echo '<td>' . "Villa ID: " . $row['id'] . '</td>';
echo '</tr>';
echo '<td>' . "Contact: " . $row['contact'] . '</td>';
echo '</tr>';
echo '<td>' . "Location: " . $row['location'] . '</td>';
echo '</tr>';
echo '<td>' . "Area: " . $row['area'] . '</td>';
echo '</tr>';
echo '<td>' . "Community: " . $row['community'] . '</td>';
echo '</tr>';
echo '<td>' . "Property Type: " . $row['type'] . '</td>';
echo '</tr>';
echo '<td>' . "Number of Bedrooms: " . $row['bedrooms'] . '</td>';
echo '</tr>';
echo '<br>';
echo '</table>';
}
//close while loop
if(mysql_num_rows($query) > 0){
//loop through the results
echo "Search conducted on: ";
echo date("l, F d, T h:i" ,time());
echo "<p>";
if(mysql_num_rows($query) = 1) {
echo '<div> ' . mysql_num_rows($query) . ' villa was found, here are your results:</div>';
}
else{
echo '<div> ' . mysql_num_rows($query) . ' villa(s) were found, here are your results:</div>';
}
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array($query)){
// Print out the contents of each row into a table
echo '<table>';
echo '<tr>';
echo '<td>' . "Villa ID: " . $row['id'] . '</td>';
echo '</tr>';
echo '<td>' . "Contact: " . $row['contact'] . '</td>';
echo '</tr>';
echo '<td>' . "Location: " . $row['location'] . '</td>';
echo '</tr>';
echo '<td>' . "Area: " . $row['area'] . '</td>';
echo '</tr>';
echo '<td>' . "Community: " . $row['community'] . '</td>';
echo '</tr>';
echo '<td>' . "Property Type: " . $row['type'] . '</td>';
echo '</tr>';
echo '<td>' . "Number of Bedrooms: " . $row['bedrooms'] . '</td>';
echo '</tr>';
echo '<br>';
echo '</table>';
}
//close while loop
//see if the query returned anything ie > 'more than' 0 rows
if(mysql_num_rows($query) > 0){
//loop through the results
echo "Search conducted on: ";
echo date("l, F d, T h:i" ,time());
echo "<p>";
$result_rows = mysql_num_rows($query);
if($result_rows = 1){
echo '<div> ' . $result_rows . ' villa was found, here are your results:</div>';
(
else{
echo '<div> ' . $result_rows . ' villa(s) were found, here are your results:</div>';
}
//loop through the results
echo "Search conducted on: ";
echo date("l, F d, T h:i" ,time());
echo "<p>";
if(mysql_num_rows($query) == 1) {
echo '<div> ' . mysql_num_rows($query) . ' villa was found, here are your results:</div>';
}
else{
echo '<div> ' . mysql_num_rows($query) . ' villa(s) were found, here are your results:</div>';
}