How to search in a database

Originally posted by : HP (,I just have a access database connected with ODBC and IIS 4.0.My Query comes from access:SELECT im.IM, im.Betreft, ("secretariaten/im/" & [IM] & ".doc") AS [Bekijk IM]FROM imWHERE (((im.IM)=[IM nummer]) AND ((im.Betreft) Like "*"+[Name your looking for is:]+"*"));Why do i get a error Please help me!

Posted On: Wednesday 7th of November 2012 02:15:17 PM Total Views:  190
View Complete with Replies

Related Messages:

MySQL search with more than 1 criteria   (92 Views)
all, first i want to appologise if the question is not in his place here but i`m really desperate, here is my question: i have 1 MySQL db with a couple of tables with lots of columns ... i was requested to make a search engine for this db and it was an offer i could not refuse, but when i began work on the scripts i found a problem ... how to make the script search the tables for more than 1 word ... i tried Code: SELECT * FROM `table` WHERE `word` LIKE `%something%` and the script works like a charm ... but if someone tries to search for "something new" ... how should i proceed I was brainstormed to try the 2 word with separate sql searches ... and after the 2 searches are over, compare the results and leave only the results that contain both words ... but if there are more than 2 words it gets ugly for the MySQL server ... please if someone has an idea how should i proceed share it with me, i would be very grateful.
Simultaneous searching over different columns?   (67 Views)
I am trying to build a system that will allow for a "Google-like" search of our site. Each page consists of a title and various other content (TEXT) fields. What I'd like to do is a search something like: select pageid from pages where title is like '%query%' or summary is like '%query%' or content is like '%query%'... for all 20 different query terms. Then I'd like to automatically highlight the matching result. Now, it seems like a bit inefficient to essentially do the same query on so many different columns...the alternative is to do a separate select statement per column (i.e., limit the WHERE to 1 column), but that also seems inefficient. Any ideas
Msyql search like %   (92 Views)
I am a beginner. I have a simple query select username from tbl_user where username like '%james%' It looks like there's no way to improve this Because it's too simple. Can I index username or it doesn't help because of like '% Thank you for any help.
Help with a MySQL search query   (106 Views)
, on my website, users can post ads (items) and attach up to 3 photos for each item. I have a search page where users can select a category, subcategory, a province, a city and then search for an item. My problem is that if an item has more than 1 picture attached to it, in the search results page, the same item appears twice, but with a different picture (ex: if the item has 1 picture it appears once, if it has 2 pictures, it appears twice, if it has 3 pictures, it appears 3 times. SAME item, just the pictures are different). Here's my function : Code: $query = "SELECT item.*, as pictureId, picture.title as pictureTitle, picture.filePath as pictureFilePath, as cityId, as cityName, as provinceId, as provinceName, as locationTypeId, as locationTypeName FROM (item, city, province, locationType) LEFT JOIN picture ON WHERE item.fk_subcategory_id=$subcategoryId AND (item.fk_user_id > 0) AND AND AND"; I would like to limit somehow that - if the item has more than 1 picture attached - only ONE item is displayed in the search results page, with one picture (first, or random).
How to implement query to search (tag, id) database?   (134 Views)
So say I have a table full of one word tags, each associated with an ID (foreign key) to something else (product, article, whatever). Each ID can have mupltiple tags, too, such as round, blue, fast... What's the best way to search on a table like this for IDs matching specific search terms The search criteria can me rather complex, too and include NOT. An example would be finding all IDs that are ((blue AND round) AND NOT fast). Hopefully that explains it.
Problem with search query using 'LIKE'   (91 Views)
Can we modify search query using LIKE %search% so that for eg: when we search for 'men' output contains only those with word 'men' and not with words 'women' , 'sacrament','menthol' etc.or is there a different query for this.Please help.I AM DESPERATELY IN NEED OF THE QUERY. , sorry, lnxgeek, but LIKE will not do want he wants please read his question again, it's right there in plain sight AjithTV, you need to use REGEXP and specifically search for men using word boundaries ... WHERE somecol REGEXP '[[::]]'
Anyway to do an AND/OR for a search?   (94 Views)
Didn't get any sleep on this... Now I have ONE text field, let's say the user searches "blue 2007 Mustang". My Table looks like: ID | COLOR | MAKE | MODEL | YEAR 1 blue Ford Mustang 2007 I have a query that looks like "SELECT * FROM cars WHERE color LIKE '%search%' OR model LIKE '%search%' OR year LIKE '%search%'" Obviously this will work if the user searches "2007" or "Mustang" but not "2007 Mustang"! Now how in the heck can I do this I've searched on here, looked into my MySQL bible book, googled it, looked at opensource search engines and I don't get it still! Then I tried a fulltext search, I had to convert my table to MyISAM (also made FULLTEXT columns: ALTER TABLE cars ADD FULLTEXT INDEX (model, color)) and tried this query: SELECT * FROM cars WHERE MATCH (model, color) AGAINST ('Green Mustang') and I get this warning: "Can't find FULLTEXT index matching the column list". There has got to be a way to make a non-fulltext search I wish there was a AND/OR opperator I'm currently trying xOR but it doesn't seem to be working like I would like it to...
Two unrelated tables in search results?   (99 Views)
Hi. I have two unrelated tables and I need to use them both for search results (they both provide the same "kind" of data but the tables and columns are quite different). Can somebody help me understand how to do this
Help: Best ways to streamline saved search keywords   (93 Views)
I'm looking for the best way to implement saved search keywords, used to search another table in my database. I have a table (searchkeywords) that stores my keywords like so: user_id, search_id, key_words which contains the following as an example: 1, 9, "Red Carpet" I then search the database by breaking up the key_words and adding them to a select statement like so: PHP Code: SELECT*FROMusersINNERJOINsearchkeywordsONuser_id Foreachuserkeywords { BreakthekeywordsintoLIKEstatments SELECT*FROMcontentWHEREcontent.titleLIKE'%red%'ANDLIKE'%carpet%' } I do this because I want it to find "Today on the red carpet" as well as "The red velvet carpet sale" I'm doing this query 1000s of times and it isn't very efficent. I'm using fulltext search already, but I thought I could combine these into one statement. I thought about creating a different input for each keyword like so: 1,9,"Red" 1,9,"Carpet" But I don't see how that would help me because I need to be sure BOTH terms are found in my search. I also thought if there was someway to create the mySQL statement and store and execute that like so: 1,9," LIKE '%red%' AND LIKE '%carpet5' " But I don't know if that is possible. Anyway, any input is greatly appreciated.
Need help with a search query   (103 Views)
ok so i have an array that contains a bunch of words. I want to use this to search through a table i have and pull out the ones that contain all of these variables. this is how my table is setup uniqueID | ownerID | tag where tag is what i want to search in for those array variables above. So each of these 'tags' belong to something else referenced by ownerID. So most of these tags will have the same owner. Some might even have the same tag, but different owner. Ok so what I want to be able to do is pull out the ownerID that contains all the elements of the array. So is there a way to accomplish this simply by a query(s) I'm using php, so the other way would be to run loops, but that might require alot of queries depending on how many elements are in the array and comparing the ownerid. thx
Fulltext search help   (91 Views)
Folks: I am having a bear of a time doing a fulltext search for IP addresses. I wanted to use a fulltext search since I am searching many fields... any help on syntax I think it is taking the "." as some other character example select field1,2,3,4, from table where match(field1,2,3,4,5,6,7,8,9) AGAINST ('' ); or in IN BOOLEAN MODE
FULLTEXT or indexed search?   (94 Views)
I'm, trying to figure out which search technique would be better to use for a search engine I'm creating for a site I'm working on. The type of data I'm working with is a database of movies and music. I have to deal with names, titles, bios, etc. The problem I have is that I'm not sure how using MySQL's FULLTEXT functionality would impact the server. So how would I determine which method is better for the type of data that I'm dealing with Max
How to search for multiple keywords properly?   (117 Views)
I know I need to do a full text search to return exact keyword matches but I am unsure how to structure the query for multiple kewords (all keywords are optional). Basically my form has checkboxes for option 1 option 2 option 3 and if the user checks more than one option it should return all results that contain at least one of those options. Can someone give me an example query please This doesn't seem to work very well :-( PHP Code: SELECT*,MATCH(Headline,Blurb)AGAINST('members,chamber,the')ASScoreFROMArticlesWHEREMATCH(Headline,Blurb)AGAINST('members,chamber,the') Edit: actually it does work but I need to be able to search for keywords down to two letters. Maybe I should stick to a LIKE search
Sql statement to search 'owner_first_name' AND 'owner_last_name'   (111 Views)
I have a search field for finding an applicant by the name of the owner of the company. I want the user to be able to type in ONE field: just the first name, just the last name, or both first and last name. Is there an sql statement to accomplish this or am I better off having seperate fields for first and last name
Case-Insensitive search   (154 Views)
Hi . Does MySQL support case-insensitive search for UTF-8 (cyrillic characters). If yes, then how to do that
Full text search   (156 Views)
; Could anyone give me a idea how to do the full text search in the following case, please Example. Say I search for 'print', I would get results returned when words such as 'printers, printing, prints etc' are found.
Fulltext search with utf-8 data   (122 Views)
Does a fulltext search work if the data is stored in utf-8 Specifically, I have some vietnamese stored in the field I'm searching on and I'm having trouble. Is there anything I need to change to make it work
Regarding Advanced searching   (110 Views)
hello, I want to search the complete tables i am having.The searching should be like the following....Say if i give the word 'caring' as the keyword for search the i should get the result from the fields which is similar to caring.. ie it should display all the fields having data,caring,very caring..etc hope u all got it..I used the fulltext function and also match() But i am not getting the deed result. regards rechu
Complex join/search query...   (157 Views)
I'm stumped... hoping someone can help here... I have 4 tables, simplified for the sake of this question: bands - bandid - bandname venues - venueid - venuename shows - showid - venueid - date / time showbands - showid - bandid - bandorder so, showbands has a many-to-one relationship with shows - there may be 5 bands playing a show... we store each bandid and what order it's playing in... I can handle this just fine with a query to list all shows, or all shows within a given date. Just join shows, showbands, bands, venues on their respective ids... I can also handle this just fine with multiple queries to list all shows where bandid=5 is playing (select my showids where bandid is present, then do the query on just those showids)... How, in one query, can I display only shows where bandid is playing, but display all n bands Is it even possible
Mysql full text search   (164 Views)
how i can use "Full-Text Search Functions (in mysql)" i can useing this function in world's english but i can not useing this function for world's farsi (or persian) please help me (with sample) i useing utf-8 char mysql version : 4.0.25-nt