I am into some problems atm, that is, I have a database of some words, which is like 900,000 and what I am trying to do is, check whether a word is in it, and if yes, return another field in the row.
I get timedout when I do that.I know I can change the timeout, but what I actually want is to make it faster somehow if possible. My visitor wont like to wait 30+ secs to get what he is looking for.
I cant make 900,000k static files because I have inodes limit in the hosting.
So I am pretty much locked up, so any thing that I can do to make it better?
Table structure :
ID | Word | Otherword
CREATE TABLE `database` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`word` text COLLATE utf8_unicode_ci NOT NULL,
`md5string` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=966277 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
Query:
mysql_query("SELECT otherword FROM table WHERE word='$word'");
Another query:
mysql_query("SELECT word FROM table WHERE otherword='$otherword'");
Main query (a file using GET)
$word = $_GET["word"];
echo $word;
$check = mysql_query("SELECT md5string FROM `database` WHERE word='$word'") or die(mysql_error());
while (mysql_num_rows($check)>0)
{
$out = mysql_fetch_array($check);
$output = $out[0];
}