473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Text search...

Best groupmembers,

I'm new to MySQL and I'm not quite sure what I'm doing wrong. I have a
table "general" that contains some columns. I want to do a search thru
it and find posts that have a specific word in the title and text
column.

This is the query that I use that creates an error.

$Query = "SELECT * FROM general WHERE MATCH(title,text)
AGAINST('$searchstring')";

This is just modified SQL from the manual on www.mysql.com

Any hints?

Cheers, Peter
Jul 19 '05 #1
2 1778
Peter the Swede wrote:
Best groupmembers,

I'm new to MySQL and I'm not quite sure what I'm doing wrong. I have a
table "general" that contains some columns. I want to do a search thru
it and find posts that have a specific word in the title and text
column.

This is the query that I use that creates an error.

$Query = "SELECT * FROM general WHERE MATCH(title,text)
AGAINST('$searchstring')";

This is just modified SQL from the manual on www.mysql.com


Hello Peter,
I'm not very familiar with the MATCH AGAIN clause (I know it but have
not used it), but I did find the following on page 129 of the MySQL manual:

To use MATCH ... AGAINST (... IN BOOLEAN MODE) with your tables, you
need to rebuild them with REPAIR TABLE table_name USE_FRM.

I know you can use the following instead:

$Query = "SELECT * FROM general WHERE title LIKE '%$searchstring%' OR
text LIKE '%$searchstring%'"

Of course, the above won't give scores. It will either find something or
it won't.

You might find some configuration insight in section 13.7 of the manual,
as well (page 613).

--
- Michael J. Astrauskas

Jul 19 '05 #2
Peter the Swede wrote:
Best groupmembers,

I'm new to MySQL and I'm not quite sure what I'm doing wrong. I have a
table "general" that contains some columns. I want to do a search thru
it and find posts that have a specific word in the title and text
column.

This is the query that I use that creates an error.

$Query = "SELECT * FROM general WHERE MATCH(title,text)
AGAINST('$searchstring')";

This is just modified SQL from the manual on www.mysql.com


Hello Peter,
I'm not very familiar with the MATCH AGAIN clause (I know it but have
not used it), but I did find the following on page 129 of the MySQL manual:

To use MATCH ... AGAINST (... IN BOOLEAN MODE) with your tables, you
need to rebuild them with REPAIR TABLE table_name USE_FRM.

I know you can use the following instead:

$Query = "SELECT * FROM general WHERE title LIKE '%$searchstring%' OR
text LIKE '%$searchstring%'"

Of course, the above won't give scores. It will either find something or
it won't.

You might find some configuration insight in section 13.7 of the manual,
as well (page 613).

--
- Michael J. Astrauskas

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SK | last post by:
Is there a way to store HTML into a MySQL TEXT column, yet be able to search over textual content only? For example, if I store the following HTML snippet: <p>A very <em>small</em>...
12
by: ljungers | last post by:
I'm on the home streach of my project and found that my "Reset for New Search" command button not working as desired. What should happen is that when the button is clicked a Event Procedure is run....
6
by: shantanu | last post by:
Hi All, I have a requirement to develop a search engine based on some search criteria that will search for the string or statement in all the documents uploaded in the website. The search result...
13
by: Robertf987 | last post by:
Hi, Yet another thing I need help with I'm affraid. I'll first explain what I want, then I'll try to explain what I have. I'm using Microsoft Access 2000. What I want is to be able to do a...
3
by: =?Utf-8?B?UGVycmlud29sZg==?= | last post by:
Not sure where to post this... Found some interesting behavior in Windows Search (Start =Search =All files and folders =search for "A word or phrase in the file:"). This applies to XP and maybe...
0
by: a | last post by:
Dear friends I have this code but not work What I want I want to design search form to search by (customerid and customername) This is the code that I want you repair it for me
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
4
by: vitaminz | last post by:
Hi it's me again, I've pretty much finished a program I'm making, which does the following: The program is for a garage, and it does the following functions: Adds a new car Display cars Amend...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.