Jump to content

search result only returns 1 record


izzy

Recommended Posts

[!--quoteo(post=379033:date=Jun 1 2006, 01:54 PM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ Jun 1 2006, 01:54 PM) [snapback]379033[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Please post code....
[/quote]

Here it the code...

$search_SQL="SELECT * FROM huis WHERE naam LIKE '%".$_POST['searchall']."%' ORDER BY naam" or die("kan geen gegevens vinden");

$search_result=mysql_query($search_SQL);
$result=mysql_fetch_array($search_result);
//afbeelding voorbereiden
$img="";
if($result['fotopath']) $img="<img width=150 height=150 src='../afbeeldingen/" . $result['fotopath'] . "'>";


?>

<table width="410" border="0">
<tr>

<span><strong><?php echo $result['naam']?></strong></span>
<td width="350">
<table width="210" border="0">
<tr>
<td width="100">prijs: </td>
<td>
<span><?php echo $result['prijs']?></span>
</td>
</tr>
<tr>
<td>regio: </td>
<td>
<span><?php echo $result['regio']?></span>
</td>
</tr>
<tr>
<td>plaats: </td>
<td>
<span><?php echo $result['plaats']?></span>
</td>
</tr>
<tr>
<td>Opp. huis: </td>
<td>
<span><?php echo $result['opphuis']?></span>
</td>
</tr>
<tr>
<td>Opp. perceel: </td>
<td>
<span><?php echo $result['oppperceel']?></span>
</td>
</tr>
<tr>
<td>inhoud: </td>
<td>
<span><?php echo $result['inhoud']?></span>
</td>
</tr>
<tr>
<td>omschr.: </td>
<td>
<span><?php echo $result['omschr']?></span>
</td>
</tr>
</table>
<td width="200">
<span><?php echo $img?></span>
</td>
</table>
<p><p></p></p>
<?php

mysql_close
?>
[code]
$search_SQL="SELECT * FROM huis WHERE naam LIKE '%".$_POST['searchall']."%' ORDER BY naam" or die("kan geen gegevens vinden");

$search_result=mysql_query($search_SQL);

//afbeelding voorbereiden



?>

<table width="410" border="0">
<?php
while ($result=mysql_fetch_array($search_result)) {
$img="";
if($result['fotopath']) $img="<img width=150 height=150 src='../afbeeldingen/" . $result['fotopath'] . "'>";
?>
<tr>

<span><strong><?php echo $result['naam']?></strong></span>
<td width="350">
<table width="210" border="0">
<tr>
<td width="100">prijs: </td>
<td>
<span><?php echo $result['prijs']?></span>
</td>
</tr>
<tr>
<td>regio: </td>
<td>
<span><?php echo $result['regio']?></span>
</td>
</tr>
<tr>
<td>plaats: </td>
<td>
<span><?php echo $result['plaats']?></span>
</td>
</tr>
<tr>
<td>Opp. huis: </td>
<td>
<span><?php echo $result['opphuis']?></span>
</td>
</tr>
<tr>
<td>Opp. perceel: </td>
<td>
<span><?php echo $result['oppperceel']?></span>
</td>
</tr>
<tr>
<td>inhoud: </td>
<td>
<span><?php echo $result['inhoud']?></span>
</td>
</tr>
<tr>
<td>omschr.: </td>
<td>
<span><?php echo $result['omschr']?></span>
</td>
</tr>
</table>
<td width="200">
<span><?php echo $img?></span>
</td>
</tr>
<?php
}
?>
</table>
<p><p></p></p>
<?php

mysql_close
?>
[/code]

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.