Toon posts:

Hoofdletter gevoelig....

Pagina: 1
Acties:
  • 118 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Zojuist zoekmachine voor me site online gezet alleen nou is er nog 1 probleempje, ik weet niet hoe ik ervoor moet zorgen dat hij bij bijvoorbeeld "john van lottum" dezelfde resultaten vind als bij "John van Lottum" (zie deze pagina voor de zoekmachine)

Ik wil dus dat hij niet hoofdlettergevoelig is, hoe krijg ik dat voor elkaar :?

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 16:30

Janoz

Moderator Devschuur®

!litemod

Hoe moet ik nou aan die pagina zien hoe jij je zoekmachine hebt geimplementeerd???

Iets meer info zou handig zijn...

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • MisterData
  • Registratie: September 2001
  • Laatst online: 07-09 20:23
RTFM ;) Maareh, er bestaat in PHP toch zoiets als tolowercase() ofzoiets ??? :)

www.php.net/docs ???

Doe je het met een SQL query ??? Dan moet je de manuals van je SQL DB lezen. Staat gegarandeerd in hoe je de query hoofdletter ongevoelig kan maken.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

Doet iets met Cloud (MS/IBM)


Verwijderd

Topicstarter
Ik zal ff kijken

Dit is trouwens de code en ja ik gebruik dus SQL:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<? 

if(!isset($trefwoord)){ 
?> 
<font face="Verdana" size="1">
<form action="zoeken.php3" method="post"> 
<input type="text" name="trefwoord" value=""> 
<input type="submit" name="submit" value="Zoeken!"> 
</form> 
<? 
} else { 
require("zoeken-conf.php3"); 
$server = mysql_connect($host,$user,$pass); 
mysql_select_db($db,$server); 
$sql = "SELECT * FROM twnieuws WHERE inhoud LIKE '%$trefwoord%' ORDER BY titel DESC LIMIT 0, 25"; 
$res = mysql_query($sql) or die(mysql_error()); 
$num = mysql_num_rows($res); 
if (empty($num)){ 
  $num = "geen"; 
} 
echo"<b>Er zijn $num zoekresultaten gevonden.</b><br><br>\n"; 
while($row = mysql_fetch_object($res)){ 
?> 
<font face="Verdana" size="1">
<a href="http://www.bezoekersaantallen.nl/~tennisweb/nieuws.php?id=<? echo $row->id ?>"><? echo $row->titel ?></a><br><br> 
<? 
} 
} 

?>

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 16:30

Janoz

Moderator Devschuur®

!litemod

Laat me raden... inhoud is van het type BLOB.. of niet soms...

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


Verwijderd

Topicstarter
klopt :)

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 16:30

Janoz

Moderator Devschuur®

!litemod

Ik neem aan dat nieuws TEXT is, mischien is het een ID om dan ook het TEXT type te gebruiken.. Als je dat nog ff naleest in de manual zie je dat die wel hoofdletterongevoelig is....

Trouwens... Stel ik wil het nieuws over Paul haarhuis.. Daar zijn 26 berichten over, maar ik wil juist het bericht met de titel "ZZZ"..

Hoe kan ik die dan vinden zonder ZZZ te gebruiken?

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


Verwijderd

denk niet, want hij zoek alleen in de inhoud, zoals je ziet.

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 16:30

Janoz

Moderator Devschuur®

!litemod

Op dinsdag 18 december 2001 20:46 schreef Mr.Eminem het volgende:
denk niet, want hij zoek alleen in de inhoud, zoals je ziet.
Dat laatste slaat op de sortering en de limit 25

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • Goodielover
  • Registratie: November 2001
  • Laatst online: 18-08 11:34

Goodielover

Only The Best is Good Enough.

Gebruik ipv LIKE :
WHERE locate('$trefwoord',inhoud)>0
Het performed voor geen meter, maar werkt weel
Pagina: 1