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.
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
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.
$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%'");
?>
thanks
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