DeveloperSide.NET Forums
November 21, 2019, 11:26:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Mysql query question  (Read 6400 times)
0 Members and 1 Guest are viewing this topic.
Alec
Member
*
Posts: 12


View Profile
« on: May 24, 2007, 10:44:23 AM »

I'm querying a table that includes a field for Authors (strArtist) in which the data is stored as "Surname, FirstName" eg: "Bloggs, Joe". So if someone searches for "Joe Bloggs", they won't find anything.

My query criteria is built by
Code:
$criteria="WHERE (strDesc LIKE '%".$_POST['qSearchText']."%') OR (strArtist LIKE '%".$_POST['qSearchText']."%') OR (strItem = '".$_POST['qSearchText']."')";

What would I have to do to make "Joe Bloggs" find a match against "Bloggs, Joe"?
Logged

i]I feel a lot more like I do now than I did half an hour ago[/i]
Alec
Member
*
Posts: 12


View Profile
« Reply #1 on: May 29, 2007, 07:31:09 AM »

Answered my own question:

Use a FULLTEXT search (Match ... Against)
Logged

i]I feel a lot more like I do now than I did half an hour ago[/i]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!