Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Searching Mysql.com


A comment was made something to the effect
that such a line in /etc/mysql/my.cnf could be
used to restrict network connections to mysql
to a specified IP address. I'm not quoting exactly,
but the idea is that if it is desired to connect to
mysql tables via say an ODBC connection, a line
like bind-address = 192.168.1.175 would allow
connections from a client pc with that ip addr.

What if I wanted to allow 2 PC's on the LAN to
connect to the mysql server on the linux box?
I couldn't find help on mysql.com for this objective.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Searching With Mysql
My table in MySql looks like this
(id:int, usrid:int, title:char(30), descr:text, imgname:char(30), imgpath:char(30), links:char(20) );

I would like to enable users online search this tables "title" and "desc". What is the best way to enable users to search for a srting of words and find matches that contains the string or part of the string.

View Replies !   View Related
Searching MySQL
I would like to search a MySQL database for a search term. I would also like it to be lenient to users. I want it the search to look for patterns, even if there are blank spaces between them.

View Replies !   View Related
Searching Mysql Db
how would you search a table , in my tables i have columns named description and keywords, I would like to be able to search these columns for words like dvd or sweater, I also have multiple tables how would I search them all for the same word without having multiple queries?

View Replies !   View Related
MySQL Query Searching
I have a database that keeps track of a persons name using one varchar field called name... name usually has a persons full name... i.e. James Lee King. i am trying to search the name field for either the full name or a partial part of the name. i.e. james and return every row that contains that name.

When i wrote the php script. It only returns a query when the search equals the full name or if i use the first name of the person. Is there any way to get a partial match using 1 field?

View Replies !   View Related
Searching A Mysql Table With Php
whats eneterd in the form lets call it "name" is included in a table feild record it returns the info for that record.

now I could do this with a SELECT * FROM table WHERE fieldname='$name' but then it will only return exact results, i wana try and work out a broader search.

View Replies !   View Related
MySQL And Searching TEXT Fields
what the best solution is for making large numbers of
TEXT (or BLOB?) fields searchable. For example, if I have a forum,
what is the best way to be able to search for specific words? How
about exact phrases?

I saw a solution where all words are preindexed in a "dictionary" like
table and then another table stores the word matches. That seems
really fast, but it has two major problems: 1) it can't do exact
matches, and 2) the match table would get insanely big really fast.

View Replies !   View Related
MySQL: Fulltext Mode And Searching More Than One Field
some quick background: I'm using MySQL 4.1.18. This is my first experience with MySQL (or any database system for that matter). I do have programming experience.

Ok, now my table:

restaurant_db
|-------------------------------------------|
| Name[varchar(200)] | City[varchar(200)] |
|-------------------------------------------|
| Jade Palace | Laguna Niguel |
| Jade Palace | Aliso Viejo |
|-------------------------------------------|
Basically I'm storing restaurants inside my database. Each restaurant has two fields: name and city. In the example above, there are two jade palaces (restaurants): one in Laguna Niguel and one in Aliso Viejo (cities).

Now I have fulltextmode working perfectly. Both 'Name' & 'City' are fulltext indexed. But here's my problem. Consider the following query:

SELECT name, city, MATCH (Name,City) AGAINST
('jade, laguna') AS score
FROM restaurant_db WHERE MATCH (Name,City) AGAINST
('jade, laguna')
The above code is stripped straight from the MySQL dev docs and modified for my purposes.

Results:

Jade Palace Aliso Viejo 0.3876339495182
Jade Palace Laguna Niguel 0.3876339495182
From the above, one can conclude that it's simply searching one field at a time and once there's a match, it doesn't bother looking for matches in other fields. In the above case, once it found a match for 'jade' (name field), it didn't bother looking into matching 'laguna' (city field).

My desire is to have the above search results reversed so that the Laguna Niguel Jade Palace comes before the Aliso Viejo one by instructing MySQL to search all fields rather than terminate upon the first match. Furthermore (this is probably obvious), I would like MySQL to weigh results with the most matches higher than those with less matches.

View Replies !   View Related
MYSQL Fulltext Search - Searching For 3 Character Words
I have fulltext search in my table. The default number of words it can search is 4.
I have requested our hosting support to reduce it to 3. They said it is not possible.

I am looking for ways to search for 3 character words also.

So, I am first checking if the string length of keywords to be searched is greater than 3.
If it is greater than 3, I am searching using mysql fulltext search.

and if it is 3, I am searching like this:
title LIKE '%".$keywords."%' OR descriptions LIKE '%".$keywords."%'

This works well if the keyword is a single word with 3 characters.
If it is a keyphrase, it is not working because string length is greater than 3.
example: 'psp downloads', 'wii downloads' etc..

Is there any better method to search for 3 character words in the search terms?

View Replies !   View Related
Searching A Row
i need to be able to do a search using the "LIKE" instance through all of them, but id was hoping to avoid having to do something like this:

first_name LIKE "%$form{'FirstName'}%",
last_name LIKE "%$form{'LastName'}%",
company LIKE "%$form{'CompanyName'}%",
street1 LIKE "%$form{'Street1'}%",
street2 LIKE "%$form{'Street2'}%",
etc....
i would have to do this like 40 times to have it search everything.

View Replies !   View Related
Searching On ý
I need to find all the instances of ý in my database, but not y. So, for example:

SELECT * FROM listings WHERE descritpion LIKE '%ý%'

produces anything with a y in it. How can I get only those records with a ý?

View Replies !   View Related
Help With Searching WHERE/LIKE/OR
I tried to search this on the forum, but 'where', 'like', and 'or' aren't the greatest of search terms...

Given a keyword, I need to search several fields for matches. I can use %$keyword% format.

This is what I have been trial and erroring:

$query = "SELECT * FROM tablename
WHERE field1 LIKE '%$keyword%'
OR field2 LIKE '%$keyword%'
OR field3 LIKE '%$keyword%'";

Can you see the error here?

View Replies !   View Related
Searching For Records
eg search for records having same email address

select txtemail,count(txtemail) from `tbl_user` GROUP BY txtemail
having COUNT(txtemail)>1;

and it works, is that the best way?

View Replies !   View Related
Searching By Tags
I have three tables: `photos`, `tags` and `tags_photos`.

The `photos` table contains a unique ID and a bunch of other stuff, the
`tags` table contains a unique ID and a tag name, and the `tags_photos`
contains the photo ID and the tag ID for an association between a tag
and a photo.

In other words, any photo may have many tags and any tag may have many
photos.

This is great for filtering photos based on tag, but I'm now trying to
allow users to search photos on multiple tags. I want users to be able
to enter a list of tags and either search for photos with "all these
tags" or "any of these tags".

I tried the query "SELECT a.* FROM photos AS a, tags_photos AS b WHERE
b.photo=a.id AND b.tag IN ($tags)" where $tags is a comma-separated
list of the tag IDs from the tag names the user entered, but of course
it returns photos multiple times if they have more than one of the
entered tags.

Any ideas?

View Replies !   View Related
Searching Algorithm
I'm developing a database for a research firm which has data they want
to search for specific criteria against varying base line data - some
of the questions that have been asked to get the raw data (which I
will import into MySQL) are like this:

how often do you use mouthwash?
etc.
etc.

The responses for each question was structured with only 4 answers
from a large group of people:
no answer
low
medium
high

Using various baselines of people, I want to build a query that will
accurately find matches and to also allow me to find 'close' matches
- for example:

if base line #1 is for a consumer who uses mouthwash a 'medium' amount
of times per week, I want to find in the database how many 'hits'
there are for that question - but I also want to capture 'close' hits
like in this example, for this specific question, if the search finds
'low' instead of 'medium' I'd like to count that as a 'close' hit vs a
direct hit (match) - then when the query is over, I'd have say, 80%
matches with (for example) 60% of those direct hits and 20% close
hits - I'm using PHP so I can use that to keep track of direct hits
and 'close' hits.

View Replies !   View Related
Searching Archives
I just joined this list and would like to search the archives before I ask a =
question. I there a way to search.

View Replies !   View Related
Searching On Two Keys With OR?
Which version is targetted for optimization of OR searching on two keys,
that is, "select * from sometable where f1 = 123 or f2 = 123",
as described in http://www.mysql.com/doc/en/Searching_on_two_keys.html
?

View Replies !   View Related
Searching On Two Keys With OR
Which version is targetted for optimization of OR searching on two keys,
that is, "select * from sometable where f1 = 123 or f2 = 123",

View Replies !   View Related
Fulltext Searching
How fulltext is working!!?

I have the following table with just one record! And when I do a select statement, mysql returns no hits!!!

Would you explain to me what is wrong?? Code:

View Replies !   View Related
Searching Blob
is it possible to search through blob data similar to full text searches?

View Replies !   View Related
Text Searching
I am using normalization on my database tables so that I can related each table to each other.The only problem is that I am using a full text search on 4 fields. These include: descrip, title, brand, category.
Now would I have to have these 4 fields in one table or could I normalize them and make split it up into 3 different tables as such.

table 1) descrip, title, brand_id, cat_id

table 2) brand_id, brand

table 3) cat_id, category

Once I have done that then would I still be able to perform a full text search on the 4 fields that I had mentioned above or would I have to keep them as one table.The main reason why I want to split them up is because in the brand and category fields I have alot of duplicate entries. Infact about 50 or so percentage of it is duplicate.I just want to try and make my dataset as small as possible as I will be having well over 2 million rows and I need the search performance to be fast.

View Replies !   View Related
Sorting And Searching.
I need to know how to display sorted queries with php,can anyone help?
I also need to know how to search a database, and display the results.

View Replies !   View Related
Postcode Searching
I have an interesting little mysql/php problem that Im trying to get my head around. Plus I thought it was long overdue that I sign up here instead of just trolling

I have a database with 3 fields

from_postcode, to_postcode, service_id

It tells me which postal services are available for a certain postcode

lets say for instance I want to search for DN2 4SQ

The match in the database would this record

from_postcode - DN0 0AA
to_postcode - DN9 9ZZ
and then I can read the service_id's in

So as you can see I sort of need to say WHERE postcode BETWEEN from_postcode AND to_postcode

But that doesnt work as its a text search - so postcodes starting with DN10 wont work as they match in the same group as above

Anyone any ideas as I've been all day

The only way I can think is to split the postcode into 4 chunks

[DN][0][0][AA] -> [DN][9][9][ZZ]

Then I can use between and less than/greater than queries to find if the search postcode is between those 2 values

View Replies !   View Related
Advanced Searching
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 ..care,caring,very caring..etc

hope u all got it..I used the fulltext function and also match() But i am not getting the desired result.

View Replies !   View Related
Searching A Column
I have a database of filenames that when someone searches for a filename it uses LIKE against the column for wildcard matching.Some of the files I have entered recently have a $ (dollar sign) as part of the filename, and they are not showing up in the results. Do I need to slash them in order to work?

like '%test$test%'

View Replies !   View Related
Searching Across Table
Suppose I have 5 fields in my database (A, B, C, D, E). Is it possible to write a query that searches all of them?
I know that I can do
Code:

select A from my_table where a like '%ponies%' or b like '%ponies%' or c like '%ponies%' or d like '%ponies%' or e like '%ponies%'

But if I have 100 fields, that would be unwieldy. I could do this very easily with PHP but would prefer to optimize the DB query.

View Replies !   View Related
Searching By First Letter
I need a query to search for entries in my table where the first letter of last_name and first_name is the selected value. So, when I click on the letter 'a', it would return all entries where the last_name and first_name begin with the letter a.

View Replies !   View Related
Searching Date
I have a date type field in my table. Say the value is this month of this year - what sql would i need to search for dates which are a certain time before todays date, like 3 months?

View Replies !   View Related
Searching Zip Codes
I have a table that includes a US zip code column. It stores a 9 digit zip in the form of 12345-6789. I would like to be able to search it with accuracy to only the first 5 digit part, but I'm not getting far with my own ideas. Can this be done?

View Replies !   View Related
Searching In 2 Tables
I got this code and it works fine exept that it only searches in in column, is there a way to do a search in 2 columns
PHP Code:

SELECT * FROM {$sqlprefix}link WHERE description LIKE '%$term%' AND active = '1' ORDER BY out DESC 

View Replies !   View Related
Searching In All Tables
If I needed some type of information lets say... errr "xlordt" information... Say I need to query this users data... but.. I dont know in what table this user is in.... Is it possiable for me to add a query to search in all tables? and give me that users information? errr probably something stupid.. but... I need to know if its possiable or not.

View Replies !   View Related
Searching Keyword
i would like to be able to search a keyword, and match it against 2 columns.
so for example, I have cli_fname and cli_sname fields, and I want to be able to search for "mark williams" and have mysql match the search term against the two fields, but treated as one (if I am making sense)
I have tried CONCAT(cli_fname,' ',cli_sname) as cli_name, but if I add %keyword% LIKE cli_name, I get an "unknown field" error.
is there a way to do this?

View Replies !   View Related
Searching Several Fields
I'm after a solution to a problem which I can solve by doing lots of queries, but was wondering if there was a more elegant mySQL way of doing it.I'm writing a calendar app which will display dates of various courses. Each course has several dates associated with it stored in several fields of a database.I want to be able to search all the date fields (stored in datetime format) and return rows which contain dates within a certain range (i.e. for a specific date).However, what I want to be able to do upon getting the row result (or several rows for several matches) is for mySQL to be able to tell me which field the match came from.

View Replies !   View Related
Searching %% With Index
I try to search %name% from a field that already indexed, but it did not work, if i search only name%, then the indexed will be used.
Anyone know how can i solve the problem so that I able to search the text faster?

MYSQL fulltext looks like a solution, but too bad it cannot search word like:

Software Engineer
-> search "ware", will not work
-> search "Software", then work

right?

View Replies !   View Related
Simultaneous Searching
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.

View Replies !   View Related
Searching Through Different Fields
I'm trying to create a search bar on my webpage. My web page is a clothes shop and I want to be able to search by brand, shop name, dept etc... Each of these is a field in the table product. Code:

View Replies !   View Related
Searching Ampersands
i have created a query that is to search text in my database and it goes well. but my friend the other day is complaining that he did not find what he search in the database but actually the data is really in there.. the data contains ampersand(&) like 'tom & jerry' and also a text 'mcs of tampa inc'.
my query is this:

select * from mytable where mytext like '%mcs of tampa inc%'
select * from mytable where mytext like '%tom & jerry%'

in the first query, it runs ok when the text is 'mcs of tampa' but if i complete it to 'mcs of tampa inc' no results has been return.
is theres a special characters their?

View Replies !   View Related
FULLTEXT Searching For *?
I have just discovered the power of FULLTEXT. But i would really like to be able to search for words like *smile*. That is, smile with astersisks around it. Is there an escape character for * that lets me do this?

View Replies !   View Related
Fultext Searching
I would like to set up a search for some sections of my site. When I try to add fulltext, I get the error that the table type doesn't support fulltext. This may be because it is not MyASI...or whatever that is. Anyway, what are my options? Do I need an index? Would searching without one be painfully slow?

Can I just conver the table type or will this cause unexpexted problems? The average row has about 1-8-25 words and I shouldn't exceed a few hundred for a while. This is a brand new site.

View Replies !   View Related
Searching Records
say i have two tables! one tables with car news and the other table with pictures of these cars.

the tables:

cars:
name
model
engine

pictures:
small_pic
large_pic

waht i want to do is get the name and then search the small_pic column in my pictures table and then output this along with my article.

e.g car name: ford i have 3 pictures in my pictures table for this car

ford1.jpeg
ford2.jpeg
ford3.jpeg

i want to output ford1.jpeg!! do i have to use a LIKE query? basically i want to show the article and the picture on the side of it.

View Replies !   View Related
Searching For Duplicates
I have a table named "article" with a mere 5,000 rows. I would like to count the duplicate titles. The following query just hangs (or at least takes longer than 10 minutes as I killed it at that point):

SELECT count(*) AS article_count
FROM article AS a1
LEFT JOIN article AS a2 ON a1.title=a2.title

Titles could be as long as 150 characters. The column named "title" is full text indexed. What am I doing wrong?

I would also like to check the article bodies for duplicates. The column named "body" could be as long as 10,000 characters and is full text indexed. Whatever solution there is for title duplicates, I would like it to also work for body duplicates. Finally, the article table is going to get a lot bigger. It needs to work with 100,000 rows or more.

View Replies !   View Related
Searching Columns?
i have a user management system in the making that stores info in a mysql DB.
For various admin functions i want to be able to search for users. I want to be able to search by fields: 'username' 'fname' 'lname' and 'id'

can i do something like:
"SELECT * FROM UMS_Users WHERE $field CONTAINS '$search'"

where $field is the field to search by and '$search' is the search term.

View Replies !   View Related
Searching A String
1. I have a list of states in a single variable, as such.

AZ CA NY NM OR


2. What is the best method to pull a match on a single state?

WHERE variable is LIKE value?

In JavaScript, I would use the indexOf like so.

if(var.indexOf(value) > -1){
THEN TRUE
}

Is there something that matchs the JavaScript IndexOf ?

TYIA!

View Replies !   View Related
Searching In Innodb
Does innodb support fulltext indexes and searching on those indexes in MySQL 4.0?

View Replies !   View Related
Searching A Table
I have a book at home that can probably help me figure it out. But until I return there this weekend, can someone give me a quick example of how to search a table and then out put a specific row. Perhaps a simple table such as

Name Scores
Paul 30
Tom 50
John 40

I'm just looking to search the table, find the match, and the output the correct scores.

View Replies !   View Related
Optimized Searching
I would like to make a search engine that is general and looks multiple tables with different categories...

What is the strategy to achieve that? I did a join and made what seemed like a good search engine, but it consumes too much mySQL power :-( It searches through all of the records (27.000)... But I don't know how to made any other way...

View Replies !   View Related
Searching And Indexes
I have a fair sized table now (1,955,041 rows) and it currently has two indexes:
PRIMARY is the ID number
and
Keywords is a FULLTEXT index of the Keywords column (Text).

In my first query type I also check two other fields: Disabled and Toplevel

SELECT * FROM files WHERE Disabled='0' AND TopLevel='clipart' AND MATCH (Keywords) AGAINST ('+tree' IN BOOLEAN MODE) ORDER by ID;

In my first query type I do not have keywords but am rather checking to see if an image belongs to a particular category like so:

SELECT * FROM files WHERE Disabled='0' AND TopLevel='clipart' AND (Category='Food' OR Category2='Food' OR Category3='Food' OR Category4='Food') ORDER by ID

My question is, are there any other indexes (or anything else) that I can do that will speed up the results?

+----------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+------------------+------+-----+---------+----------------+
| ID | int(20) unsigned | | PRI | NULL | auto_increment |
| Disabled | char(2) | | | 0 | |
| TopLevel | varchar(50) | | | | |
| Keywords | text | | | | |
| Category | varchar(100) | | | | |
| Category2 | varchar(20) | | | | |
| Category3 | varchar(20) | | | | |
| Category4 | varchar(20) | | | | |

View Replies !   View Related
Searching From Two Databases
I have two databases, one called codes and one called crs_wk. One contains a table called school_1 and the other one school_2. Both tables have a column called school_name.

I want a query that searches from both databases.

something like this...

SELECT * FROM crs_wk.school_1 union codes.school_2 where school_name like "cypress%"

but it doesn't work. How do i do this?

View Replies !   View Related
Searching Query Help?
I need to search from a form in my website which has one textbox and i need to search from the text box from all the fields in 2 different tables which have similar data on...

This is what i came up with so far...

SELECT *
FROM female_models
WHERE concat( name, height, waist, hair, eyes, hips, shoe, bust, race ) LIKE '%anna%'

SELECT *
FROM male_models
WHERE concat(name, height, waist, hair, eyes, collar, shoe, chest, race,) LIKE '%anna%'

And these work both on their own, but i need to merge them into one because at the moment it just displays lots of things and not seperate rows from individual search results.

View Replies !   View Related
Searching A Database?
Does anyone know of any tutorials or documents which would help someone like myself work out how to search a database and calculate relevancy.etc. I'm creating an auction site and so I want people to be able to search both the title and description of what is being sold. I want the results ordered by relevancy. But I have no idea how I'd work out what's more relevant?

View Replies !   View Related
Searching Across Two Columns
I'm trying to search two columns - phone_brand and phone_model.

I'm using the following query of which will successfully match something like Nokia or 6133, but not Nokia 6133. I realise this is because the wildcards will only match either side (or one side in the case of the brand column), so I was wondering, what would be the best way to match the whole string?

$sql = "SELECT col1,col2 FROM mytable WHERE (phone_brand LIKE '".$var_keywords."%') OR (phone_model LIKE '%".$var_keywords."%') AND status=1";

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved