Search: Remove Quotes From Database For Search
I am making a book site and currently in the database are book titles likes "John's Trip" and "Peter's new bike". I have a search function where the customer can type in "Peter's" and it will bring up everything with "Peter's" in it.
But i was wonderind is there any way i can search for "Peters" and "Johns".
View Complete Forum Thread with Replies
Related Forum Messages:
Fulltext Search Search Blob?
Does the fulltext search is a good way to find words in a table which contains more than 500'000 rows, moreover it will search in blob field. What's your opinion about fulltext in big table ?
View Replies !
How To Search Other Tables In Search Query
I've got a search query for my website that I'm having problems with. Basically I can't get it to search the fields "summ_towns.town_name", "summ_states.state_name", "summ_countries.country_name" because they're not in the same table I can't include them in my MATCH/AGAINST query. What I'd like to do is search against a town, then state, then country before getting to the MATCH/AGAINST clause. I've tried including OR operators to do this, but it always mucks up the AND clauses above. Would someone be able to show me how I can do this without confusing the different operators?
View Replies !
Search The Whole Database
Is there a way to search all tables in a database for a keyword using 1 query? Something like SELECT * FROM ??? WHERE ..ummm you know what,,I cant do it ,,please help
View Replies !
Database Search Approaches
can i put together a site search tool for a e-comerce site that draws from a mySQL database. They are currently using a tool (Swish-e) that relies on an index of their site. I don't know a lot about searches & it got me wondering if it is faster to query the database directly or may a daily index and search that, like they are currently doing? I don't believe they get a ton of hits on their search engine. I think they get around 120 orders a day, if you can deduce anything from that. I'm also curious about the flexibility I would have to modify the way the program searches in the future. If I were using an indexed version it seems like it might be hard to produce advanced searches (all <color> tv's from <manufactuer>)
View Replies !
How To Search Mysql Database Using Php
in my mysql database table, i have 1. "this is mysql practice search test" 2. "that was my mysql practice search test" if i use ** "SELECT * FROM `table` WHERE `def` like '%mysql%' order by id" it returns both rows but .. if "SELECT * FROM `table` WHERE `def` like '%mysql my%' order by id" doesn't return anything. how to search table with more than one word from that may be in same field or different field of any row of table.?
View Replies !
Very Basic Database Search
Have a very basic database of contacts that I want to make searchable via PHP. Have successfully constructed the database, and can connect and get a basic search, but not sure how to get what I want. Table name: Business Fields: ID (key),Name,Address,City,State,Zip,County,Region,Phone,Fax,Email,Category (4 main categories),Type,Web,Contact Vision for search page: unified search, possibly with Category field being main selection (checkboxes, maybe), then refining search by City, County, Region, Type only. Results will be set off in a <div> to the right.
View Replies !
Database Search Webpage
My Mysql database is completed with test data. Now, I am ready to have this info appear as a searchable database on its on web page. How is this done?
View Replies !
Techniques Available To Search A Database
Can someone provide a list of the most common techniques used to search a database for matches based on user-entered keywords etc? At this point the only SQL syntax I'm aware of to search a db is using the LIKE clause: SELECT article FROM mytable WHERE article LIKE "php variable"; Is this an efficient enough way, even for a large table? For example, what kind of algorithm do commercial scripts like VB or blog use to search its content?
View Replies !
Search & Replace In Database?
I want to change a website from XHTML to HTML, so I have to get rid of my closing tags, such as... <meta tags /> <image src="" /> <br /> I can clean up most of my site with Dreamweaver's search and replace function. Is there a way to do something similar with my database, preferably using phpMyAdmin? If so, will it let me use regex (for meta tags and images)? Also, I know how to use phpMyAdmin's Search function, but is there a way to search for a specific item in a field, like " />" or "<br />"?
View Replies !
Search Through MySQL Database For Names
One of my rows is named 'Name' which has a string of the name of a person e.g. 'John Doe' I made a form which does this <input type="text" name="search"> <input type="submit"> $result=mysql_query("SELECT * FROM table WHERE Name LIKE Search") Which I thought would work but in the search field I have to type out the entire string e.g. John Doe instead of only John
View Replies !
Fastest Way To Search A Large Database Table
I have a table of about 10 million rows and need to search 4 of the columns. Right now I am using mysql's built in fulltext searching capabilities, but as far as speed, it isn't cutting it. I'm getting anywhere from 10-50 seconds for a single search depending on the length of the query. Plus, since the results are paginated, the query needs to be run twice. I was just thinking there must be a method that is faster than this....
View Replies !
I Have A Search Form To Search Through The DB.
I have a DB with 50,000 entries. I have a search form to search through the DB. If the recno=30123456 and you search the recno, you get that one file. what if i want a query that searches alll recno's that contain 30?? Can I do that using mysql or do I need to program that in my java app?
View Replies !
Special Characters :: Single Quotes And Double Quotes
i have developed a Content Management System using ASP.NET and MySQL database. While submitting the Content, the MySQL tables aren't accepting single quote('), Double Quotes("), html tags (<br><font>) long dash(-) etc. that are there in the news stories. Please visit http://67.18.142.206/newlayout/dec22002/1619320021213.aspx to see the problem. Can anybody tell me how to store them in the MySQL tables. i am aware about PHP Addslashes & stripslashes but they don't work with ASP.NET i think
View Replies !
Remove Whitespace From Database
I have a table of book descriptions that contains a massive amount of whitespace at the end of each row (75,000 rows). The resulting table is 495 MB. I couldn't figure out how to get rid of this space when I imported from the original text file. I can RTRIM the data when I run a query, but how do I actually remove the whitespace from the database. The only thing I can think to do is to run a query on the table with RTRIM, export the results, delete the original table, and import the table that I exported earlier.
View Replies !
Search WHERE SUM
What would be the proper way of generating a query like the following; SELECT id FROM sales WHERE SUM( totalsales) <= '20000' GROUP BY id; Assuming the table looks like this; Sales: Id| totalsales| monthyear 1 | 100| 2003-09 1 | 10000| 2003-08 1 | 2000| 2003-07 2 | 30000| 2003-05 3 | 10000| 2003-06 3 | 10000| 2003-05 I want the query to return id 1 and 2 as the sum of their totalsales is smaller then 20000.
View Replies !
Search?
I builded a little propert database. I added a search function to the site but have the following problem: I used "SELECT * FROM table1 WHERE area ='province' and type like'%type_1%' and town like'%town_1%' and descr like '%descr_1%' and suburb like '%sub_1%'" But it do not do the like thing. If I search for 3 bed and the actual data is 3 bedroom it gets the data, but if I search for 3 bedrooms (extra s) it do not get it or if I make spelling mistake I do not get a result either. So it seems that it rather search for the exact term instead of the like term. How can I get it to really search for only a phrase, part of a word or a spelling error?
View Replies !
My SQL Search
I'm currently using the following mysql statement to perform a search. Right now it is only returning the results which are found in the description field. How do I modify this statement so that it is searching the following fields: company_name, product_name, description. SELECT product_id, company_name, product_name, url, description FROM product, company WHERE product.product_id = company.company_id AND description regexp '#FORM.query#
View Replies !
Search Between A - J
I been looking a ways to do this but I can't seem to do it or get my head around it. I want to basically search my table for all "titles" begining from A - J. I want the SQL to check the first letter of the "title" and if the first letter starts with any letter between A - J I want it to be displayed. How would I do this? So far I have: Code: SELECT title FROM pmc_keyclients WHERE LEFT(key_title, 1) = 'A' But this let me search BETWEEN latters
View Replies !
Search EVERYTHING For ANYTHING
I got a database here with multiple rows/columns inside. Example: I have columns date, text1, text2, text3, and so on... Select * from db where "%" = "1969" So I wanna search EVERYTHING in the db for ANYTHING that says 1969. Whats the query to do this?
View Replies !
SQL Search
I am migrating my site over to mysql and was wondering how I can implement my same type of search into the territory of mysql. Basically this is how the search worked for the db files (terribly inefficient but it worked well). Spliting each line at the deliminator, it would match the query against 10 different values and depending on the value being matched if a match was found the item would get a score. Each column had a higher score depending on which was most important. I basically used a regex expression to count the matches and multiply it by the matchscore. Is there anyway to use LIKE and find out how many times it matched? Can I use REGEXP and get a match count with the global switch?
View Replies !
Search Box
I am trying to have a search box on every web page in the site - like everybody seems to have these days, anyway, according to DW help the search page results holds the key to how it searches the database, but the trouble I am having is what to put in the sql box for the query? I know SELECT * FROM table will select everything and I know SELECT * FROM table WHERE location = 'town' ORDER BY price etc,etc. But what I need to know is how to have the results page display one set of results if a user enters one topic in the search box and another set of results if something else is entered. And if there is nothing to display, how do you configure that?
View Replies !
Using LIKE In A Search
First off, I apologize if I am in the wrong forum. My question is kind of simple, if I use "SELECT from INVENTORY WHERE item_desc like '%blue%' OR item item_desc like '%stand%'; can i assume that LIKE is "not" case sensative????? so far that is the case, however, I can't find where in the documention to make sure of it. doing a search for LIKE in the documention is just ever so special. so i want to ask people who know. is LIKE case sensitive, or not?
View Replies !
Using LIKE To Search
I have been using the following to search: WHERE FirstName LIKE '%$firstName%' AND LastName LIKE '%$lastName%' AND Email LIKE '%$email%' AND EmployerLocationName LIKE '%$venue%' AND State LIKE '%$state%' AND MemberApproved LIKE '%$status%' AND tblmanager.mngNBR LIKE '%$mng%' It has been working well but the only thing I realised with the mngNBR, if the user selects say 'Joe Bloggs' and in the database he is number '2', it also outputs all the results of other managers who have number '2'... so Matt Smith '22', John Smith '24'... I'm assuming this is because I have used like but is there any other way I can do it?
View Replies !
SQL To Use For Search
I am creating a script that searches the table "sites" in the database "actionhostsearch". I have a column in my table called "keywords" and i want to check that against my entered text, I am currently using LIKE but don't get a good result, is there a way I can refine it? The keywords are space separated, but i want it to search like multiple keywords. Is there anyway of doing this or would i have to separate the keywords out using php?
View Replies !
Best Way To Search
I am a little confused on the best way to search a mySQL database with PHP. Which is better? 1. Search with LIKE and a trimmed term SELECT * FROM tablename WHERE field1 LIKE "%$trimm%" OR field2 LIKE "%$trimm%" OR field3 LIKE "%$trimm%" ORDER BY field1 DESC 2. Using mySQL's 'match against'
View Replies !
How To Remove The Related Privileges Of Accouts When Drop A Database?
I 'am using Mysql 5.0. When I drop a database, but the related accounts still exist, how can I remove the privieleges in these accounts which used to access this removed databases ?But I do not know which accounts can access db2 before. e.g. some accounts with select ,delete update to database db1 ,db2 and db3, when I drop db2, how to remove the privileges related db2 in these accounts ? but not impact on other accounts and databases ?
View Replies !
Plural Search
Can anyone enlighten me on how to include plural searches with a fulltext mysql database search? For example, if someone searches 'restaurant' I want it to search the database for 'restaurant' and 'restaurants'
View Replies !
Text Search
I have a varchar field to search. There are 5k records. I'm using: WHERE name LIKE '%outer banks%' It seems to be very slow. I was reading about full text searches. Maybe I could do something like: WHERE MATCH ('name') AGAINST ('outer banks') I'm looking for a quick way to search. Does anyone have any suggestions?
View Replies !
Text Search...
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?
View Replies !
Detailed Search
$query = "SELECT * FROM airplane WHERE airplane_text LIKE '%" . $keywords[0] . "%' or spacific_type LIKE '%" . $keywords[0] . "%' ORDER BY price asc"; Can anyone give me advice on how to add to this above sql statement from php to also use a grouped search so that my search is much more refined. (ie. to find donald trump you would type "donald trump" instead of getting all results for donald and all results for trump. Or also be able to do 'Donald AND Trump')
View Replies !
Dynamic Search
I run a website, and after the last update to the db code, I noticed that I missed a semicolon in some html stuff that is dynamically stored in the database. I put in   instead of etc in the database, and after a week I've got about a million records that I have to change. I'm just curious, can anyone think of a way to do some sort of search & replace thing for the data stored in the fields? I mean, it's easy to find them with something like select field1, field2 from table where field1 like '% %' or field2 like '% %'. The problem is since the content is dynamic, I'm not sure of how to update the fields to according to standard. The fun part is that IE doesn't complain for a bit when omitting the semicolon. MS and standards. That's why the whole thing passed me by unnoticed.
View Replies !
Dynamic Search (where 1=1)
is there a better way to do a dynamic search than using where 1=1? Ive used where 1=1 in the past with access databases but never with my sql and i dont seem to be able to get it to work with mysql as it just returns all the values from the datbase. the selct bit im using is Code: MM_rsCars_Source="SELECT * FROM cars WHERE (1=1) AND Active = 1" Im then filtering the makes table on the makeID passed through but it keeps displaying all the makes.
View Replies !
Email Search
I have 2 varchar columns for email and web addresses. I have indexed the columns so that the users can search. But I can't use %email% since I don't get indexing benefit. Is there any other way to achieve this. The email addresses are something like this... oshantanu23@yahoo.com and I am searching only for the word shantanu.
View Replies !
Getting Search Results
I have a table of posts which contains parent post and replies (structure below). I am having difficulty returning search results from this. What I want to do it search all rows title and body fields for matches, however I only want to return a rows parent in the results regardless of weather the parent contains the search term or not. What I can't figure out how to do is remove child rows from the search results while also getting the parent row if it does not contain the search term.Structure: id parent_id -> is 0 if post is the parent user_id title body I am also joining the results to the users table so that I can display the username associated with the post in the results.
View Replies !
Search In A Table
I have a table like this: table + --------- + ----------- + | name | ID | + --------- + ----------- + | Jhon | 1 | + --------- + ----------- + | Jhon | 2 | + --------- + ----------- + | Robert | 3 | + --------- + ----------- + I want to serach table.name for the number of times Jhon is on the table and order it , and the result would be and array of: Jhon, Robert ; the first been the most common (jhon), and last the less common (robert).
View Replies !
How To Search Over 3 Tables
The project we're working on is a document retrieval system I have 3 tables as follows. Table 1 contains words from a example doc. Table 2 contains words from documents in a database. Table3 contain only one column ‘DocID’. I would like to search the database to find those docs similar to the example doc by calculating similarity score between the example doc and each doc in the database. Specifically, the simi score is calculated by adding up the sum of word frequencies of all matched word. Additionally, I am only interested in the those documents whose DocID appear in table3. Code: Table 1 Word Freq Book 2 Desk 3 Pen 3 Board 3 Table2 DocID Word Freq 1 Book 3 1 English 2 1 Math 1 2 Desk 2 2 Machine 5 2 Power 2 3 Desk 3 3 Teacher 3 3 Class 2 4 Building 1 4 Tower 2 Table3 DocID 1 2 I am not sure the following statement is correct or not Code: SELECT DocID, table1.Freq+ table2.Freq FROM table1, table2, table3 WHERE table1.Word = table2.Word AND table2.DocID = table3.DocID;
View Replies !
LIKE In Search Function
my mysql server experiences really high load average and this is function which is rans most, does anyone know how to rewrite optimize this? Would be appreciated , thanks. if ($q) { $exp = explode(" ",$q); for ($i=0; $i<count($exp); $i++) { $hvahvor .= " && title LIKE '%$exp[$i]%'"; } } $this->get = mysql_query("SELECT id,type,title,url,sname,surl,date FROM $this->mysql_tb_dl WHERE $hvahvor ORDER BY id DESC LIMIT $this->page, $this->limit");
View Replies !
Limiting Search
i only want to records on this page were the value lot has been duplicated within the colum lot. can anyone help me here please. $query = "SELECT * FROM main GROUP BY lot ORDER BY time, part LIMIT $start, $display";
View Replies !
PHP Search Engine
I have a small news archive on my database. basicly the database stores the news title, and link (i.e. bbc's site).. As the archive grows i thought it would be good to implement some kind of search feature. I have been trying to use FULL-TEXT SEARCING in mysql without much luck.. it works (kinda) but its not exactly what i want.. Most of the titles have "TWI" in them, and lets say someone searches for it, nothing comes up because 1) its in more then 50% of the titles, and 2) its under the default char length.. Keeping in mind that this is a small database, Are there any other ways to make a search engine with PHP & MySQL which will return RELEVANT results? ifso, how?
View Replies !
MySQL Search
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,
View Replies !
Boolean Search
I am using boolean search where I need to use the normal mysql default stopwords list. But as I am including uk information in my search results so I need to use a boolean search for uk, which is not returning any results due to the keyword being only 2 characters. Is there any way that I can do something so that the "UK" keyword can be included in the search results, but not any other word that is normally stoped by the default mysql stopwords list.
View Replies !
|