Simpel if - else spg.
HejHar fundet dette søgescript.
Jeg vil dog gerne at den skriver en tekst hvis den ikke finder noget indhold der matcher søgningen...
Kan nogen hjælpe med det??
<div id="leftfrontpage">
<?
// Now collect all info into [B]$item[/B] variable
$item = $_REQUEST['search'];
// This will take all info from database where row [I]tutorial[/I] is $item and collects it into [B]$data[/B] variable
$data = mysql_query("SELECT * FROM content WHERE content LIKE '%$item%'");
// This creates a loop which will repeat itself until there are no more rows to select from the database. We getting the field names and storing them in the $row variable. This makes it easier to echo each field.
while($row = mysql_fetch_array($data)){
echo $row['date']. "<br>";
echo $row['id']. "<br>";
echo $row['headline']. "<br>";
}
?>
</div>
