Afficher un message
Vieux 01/05/2008, 09h47   #1
Marty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut wild card ` too wild `

hi pehaps you can , fairly new to php and mysql.
include below is an excerpt of a script that i've been using and runs
well on 5.2.5 php version and 5.0.51 mysql version on an apache
server.

my question: how do i modify it so that if i punch in say the vowel
a
i'll get a return of articleTitle(s) beginning with that vowel only
and not
an extensive list of articleTitles containing the vowel a anywhere
within.

thanking you in advance,
Marty.

$SearchString=$_POST["SearchString"]; // Get the search tearm
If($SearchString == "") $SearchString=$_GET["SearchString"];
the search tearm
If($SearchString == "") {
Echo"Nothing to Search For";
exit();

}

$SearchResult=mysql_query("SELECT * FROM Articles WHERE ArticleTitle
LIKE '%$SearchString%' ORDER BY ArticleTitle") or die(mysql_error());

While($row = mysql_fetch_object($SearchResult)) {
Echo $row->ArticleTitle . "<BR>";
  Réponse avec citation
 
Page generated in 0,04834 seconds with 9 queries