Click here to Skip to main content
15,896,606 members
Home / Discussions / Database
   

Database

 
GeneralSQL Server Syntax for a CROSSTAB QUERY in MSAccess Pin
acosmin19-Nov-02 22:39
acosmin19-Nov-02 22:39 
GeneralUser / system objects Pin
leppie19-Nov-02 12:22
leppie19-Nov-02 12:22 
QuestionCreate table and choosing a datetime format ? Pin
Bart-Man19-Nov-02 9:05
Bart-Man19-Nov-02 9:05 
AnswerSolution to my problem Pin
Bart-Man19-Nov-02 10:34
Bart-Man19-Nov-02 10:34 
GeneralMove data from SQL Srever to Access Pin
Ravish18-Nov-02 23:28
Ravish18-Nov-02 23:28 
GeneralRe: Move data from SQL Srever to Access Pin
Michael P Butler18-Nov-02 23:38
Michael P Butler18-Nov-02 23:38 
GeneralRe: Move data from SQL Srever to Access Pin
Paul Watson19-Nov-02 10:57
sitebuilderPaul Watson19-Nov-02 10:57 
GeneralSQL help...actually mySQL sorry Pin
Hockey17-Nov-02 19:52
Hockey17-Nov-02 19:52 
I am trying to (re)write a knowledgebase, cuz it sux a$$.

Anyways...I have a keywords field in the database and the user enters keywords into an input field.

The code constructs a query which looks something like this:
SELECT * FROM kb_articles WHERE Keywords LIKE '%Show%' OR Keywords LIKE '%Me%' OR Keywords LIKE '%the%' OR Keywords LIKE '%money%'


I'm not a whiz at SQL so i'll explain myself here a little incase my syntax if off or something...

Obviously i'm selecting records from a table called kb_articles which has the following structure:

PKID | Question | Answer | Keywords | 


Keywords and Answer should be searched for potential results. As far as I can tell, the above won't work (i'm using mySQL BTW) because LIKE chokes on multiple words.

Example?

Question entry page:
Question: How can I make lots of money?
Keywords: Show me the money


The script then parses Keywords and Questions into individual array elements (seems logical) and those items are what get compared to each record inside kb_articles keywords field. Only the keywords field can also have multiple keywords and these aren't parsed into indy words, so basically what's happeneing is this:

kb_articles.keywords = "How, To, Show, The, Make, Money"

SELECT * FROM kb_articles WHERE keywords LIKE '%Show%'....


LIKE i think chokes on multiple words inside the database keyword field...

So my question is this...Is there a way I can use SQL regex to compare I have no idea about anything REGEX... Blush | :O or am I going to have to execute multiple queries constructed using PHP...?

Thanks in advance Smile | :)

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
GeneralRe: SQL help...actually mySQL sorry Pin
Mazdak17-Nov-02 20:12
Mazdak17-Nov-02 20:12 
GeneralRe: SQL help...actually mySQL sorry Pin
Jason Henderson18-Nov-02 5:52
Jason Henderson18-Nov-02 5:52 
Questionwhat kind of DB uses .idx and .dat files Pin
Robert Smit14-Nov-02 23:32
Robert Smit14-Nov-02 23:32 
AnswerRe: what kind of DB uses .idx and .dat files Pin
Michael P Butler14-Nov-02 23:45
Michael P Butler14-Nov-02 23:45 
GeneralRe: what kind of DB uses .idx and .dat files Pin
Robert Smit15-Nov-02 0:48
Robert Smit15-Nov-02 0:48 
GeneralRe: what kind of DB uses .idx and .dat files Pin
Michael P Butler15-Nov-02 1:07
Michael P Butler15-Nov-02 1:07 
QuestionBest way to protect MDB file? Pin
LukeV13-Nov-02 9:59
LukeV13-Nov-02 9:59 
AnswerRe: Best way to protect MDB file? Pin
Vasudevan Deepak Kumar17-Nov-02 23:44
Vasudevan Deepak Kumar17-Nov-02 23:44 
QuestionADO Memory usage - leak? Pin
Gizz13-Nov-02 5:43
Gizz13-Nov-02 5:43 
AnswerRe: ADO Memory usage - leak? Pin
Mazdak14-Nov-02 5:47
Mazdak14-Nov-02 5:47 
GeneralTerminal Services Web Connection via ado(using c++) Pin
BP potato12-Nov-02 16:44
sussBP potato12-Nov-02 16:44 
GeneralDecimal precision Creating Table Pin
Anonymous12-Nov-02 8:19
Anonymous12-Nov-02 8:19 
GeneralRe: Decimal precision Creating Table Pin
Mazdak12-Nov-02 18:56
Mazdak12-Nov-02 18:56 
GeneralRe: Decimal precision Creating Table Pin
Anonymous13-Nov-02 5:40
Anonymous13-Nov-02 5:40 
GeneralRe: Decimal precision Creating Table Pin
Mazdak13-Nov-02 8:07
Mazdak13-Nov-02 8:07 
GeneralRe: Decimal precision Creating Table Pin
José Luis Sogorb14-Nov-02 5:03
José Luis Sogorb14-Nov-02 5:03 
GeneralRe: Decimal precision Creating Table Pin
Mazdak14-Nov-02 5:08
Mazdak14-Nov-02 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.