GetDotted Domains

Viewing Thread:
"MySQL Database for my seach engine"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Tue 10/08/04 at 17:08
Regular
"^^^New Online Arcad"
Posts: 1,369
Hi, on my site instead of having a huge list of games i am wantin to create a search engine. I have been told to create a MySQL data base. So far i have done this and been able to connect to it.

My next step is to add colums and rows to it so i can add my data. I am ok with all this so far, but what i would like to know is it possible to view the table i am creating ?

i might sound a bit thick like but isnt everyone when they try something new..lol

ALex
Wed 11/08/04 at 08:21
Regular
"It goes so quickly"
Posts: 4,083
I've never actually got around to using it in PHP, but I'm pretty sure it returns as any other SQL query would.

To add a full text, either define it in the SQL to create the table:

CREATE TABLE IF NOT EXISTS products (
productid MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
producttitle VARCHAR(100) DEFAULT NULL,
description TEXT DEFAULT NULL,
FULLTEXT INDEX (producttitle,description)
) TYPE=MyISAM;

Or add it to an already created table:

ALTER TABLE products ADD FULLTEXT INDEX(producttitle,description)

(you may need to use the above in PHPmyadmin, as I'm not sure if it lets you define a full text index within it)

And to run a query, use the syntax:

SELECT * FROM products WHERE MATCH (producttitle,description) AGAINST ('search terms here');

or as per Turbo's example below:

SELECT * FROM products WHERE MATCH (producttitle,description) AGAINST ('The quick brown fox jumped over the lazy dog');

It can get more advanced, but that it something that you should look into once you've got a grasp of the basic concept.
Wed 11/08/04 at 01:34
Regular
"Eff, you see, kay?"
Posts: 14,156
Thanks, I will remember that. I've never done searches of a MySQL database before.
Tue 10/08/04 at 21:28
Regular
"It goes so quickly"
Posts: 4,083
If you're building a search engine, try googleing for 'FULL TEXT INDEXES', which can be a lot more powerful than using the SQL 'LIKE' clause.
Tue 10/08/04 at 20:48
Regular
"Eff, you see, kay?"
Posts: 14,156
Heh you can't expect any of us to help you with a search engine. I will write something quickly though:


$words = "The quick brown fox jumped over the lazy dog";
$awords = split(" ", $words);
$qstring = join("%' and columnname LIKE '%", $awords");

$query = mysql_query("select * from tablename where columnname LIKE '%$qstring%'");

?>
Tue 10/08/04 at 19:01
Regular
"Chavez, just hush.."
Posts: 11,080
There's LOADS of tutorials if you search Google.
Tue 10/08/04 at 18:53
Regular
"^^^New Online Arcad"
Posts: 1,369
right, thanks a lot for that, managed to sort all that out :D, now my next problem, setting up a search for people to search the database.
Tue 10/08/04 at 17:22
Regular
"^^^New Online Arcad"
Posts: 1,369
ok i'll give it a try

thanks
Tue 10/08/04 at 17:18
Regular
"Eff, you see, kay?"
Posts: 14,156
Install phpMyAdmin. [URL]http://www.google.com/search?q=phpmyadmin[/URL]. All you need to do is download, unzip, change a few parameters then upload again. Your web host might even have it installed already.
Tue 10/08/04 at 17:08
Regular
"^^^New Online Arcad"
Posts: 1,369
Hi, on my site instead of having a huge list of games i am wantin to create a search engine. I have been told to create a MySQL data base. So far i have done this and been able to connect to it.

My next step is to add colums and rows to it so i can add my data. I am ok with all this so far, but what i would like to know is it possible to view the table i am creating ?

i might sound a bit thick like but isnt everyone when they try something new..lol

ALex

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!
Excellent support service!
I have always found the support staff to provide an excellent service on every occasion I've called.
Ben

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.