[PHP] fetching words

2005-10-19 Thread Jad Madi
Hi,
guys I have two tables, articles and keywords, what I want to do is to
scan articles and grab every single word
used in an article to the keyword table
any idea how to do that
--


Regards
Jad madi
Blog
http://EasyHTTP.com/jad/
Web standards Planet
http://W3planet.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] fetching words

2005-10-19 Thread Jim Moseby
 
 Hi,
 guys I have two tables, articles and keywords, what I want to do is to
 scan articles and grab every single word
 used in an article to the keyword table
 any idea how to do that
 --

Vague question, and I suspect that there is a much better way to do what you
are trying to do, but since you didn't elaborate, here goes:

?php
// code here to select article_number, article_text from table

$article_number=$row['article_number'];
$article_words=explode($row['article_text']);
foreach($article_words as $word){
  $sql=insert into keywords (article_number, keyword) values
($article_number, '$keyword');
  //code here to toss out common words ('a', 'the', etc), execute 'insert'
query, error check, whatever else
}
?

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php