You are here: RE: [PHP] fetching words « PHP « IT news, forums, messages
RE: [PHP] fetching words

Posted by Jim Moseby on 10/19/05 15:55

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация