oracle259 Posted September 26, 2006 Share Posted September 26, 2006 How do i go about checking if a word stored in a database is included in word submitted from a form. For example:form input = clansmandatabase input = clanfor far i have tried the following:while ($rec = mysql_fetch_array($result)) {$database[] = $rec[word];}foreach ($database as $db) {if (stristr(trim($userinput), $db)) {echo "$db is a subsect of $userinput";}}But it produces alot of loops of the echo statement.What am i doing wrong Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.