After I finished the 3 Pan Galactic Gargle Blasters, Kim Schulz
<kim@schulz.dk> just offered me, he muttered some weird stuff, and I
had to correct this gibberish:
>Hmm jeg har nu følgende...
Hmm, prøv følgende
$searchwords = explode(" ",$searchword);
// hvor $searchword er feltet brugeren indtaster i.
$query = "SELECT tekst FROM tips WHERE";
$i = 0;
while($searchwords[$i]) {
if ($i != 0) { $query .= " AND"; }
$query .= " tekst LIKE '%".$searchwords[$i]."%'";
$i++;
}
unset($i);
$result = mysql_query($query) or die("Fejl: ".mysql_error()." SQL:
".$query);
while (list($tekst) = mysql_fetch_array($result)) {
print $tekst."<br>\n";
}
--
Martin Mouritzen. |
http://www.trendy.dk
The truth is out there! Does anyone know the URL?