RE: fetching words

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux