Thanks for the points. Good luck with your project, ~Ray
Main Topics
Browse All TopicsI am trying to save some XML/RSS data from my page into my MYSQL datasbse using PDO.
I have finaly parsed and external RSS feed and i am displaying the articles on my site. /all is working fine so far in that respect. Now what i want to do, but unable to figure out how to do it is this.
Each article dispayed on my page has a checkbox next to it, and a submit button on the bottom of the page, I want to beable to have a user, check articles and then save articles into my mysql database, which they will beable to retrieve at a later date.
I want to save to a table called 'articles' the title, link, and cateogory(which will be either smoking or neuroscience) also need to retrieve the full article and save that to the field 'body'.
So at the moment the title and link are being shown on my page, ( <a href='$friendly'>$RSSitem-
Really stuck on this, I have got so far, now just hit the brick wall : ( any ideas ?
Thank You.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: Ray_PaseurPosted on 2009-01-09 at 08:55:18ID: 23337470
Suggest you try it this way, in several steps.
www.medica lnewstoday .com/print erfriendly news.php? n ewsid=1348 27");
First off, you might want to save ALL the articles in the data base. You will give each one an article-id, UNIQUE. You would not want to save the articles individually - that would probably lead to saving the same article more than once.
To grab the entire article, you can do this:
$html = file_get_contents("http://
Next you want to create a table of "my_saved_articles" It will contain the user-id and the article-id.
To find anyone's articles, you SELECT article-id FROM my_saved_articles WHERE user-id = [your client].
You might want a garbage collection scheme that periodically looks through the articles, selecting the user_id from my_saved_articles where article-id = current article and save-date > 30 days ago. If there is nothing in the query result set, you know that nobody checked that article. That way you can delete old articles that did not capture anyone's fancy.
To put up a form with information from checkboxes, you can do something like this:
<input type="checkbox" name="article<?php echo $article_id;?>" />
To find which articles were checked, you can do this sort of thing in the action script:
foreach ($_POST as $key => $value)
{
if substr($key,0,7) != 'article') continue;
$article_id = (int)substr($key,7,999);
$sql = "INSERT INTO my_saved_articles (user_id, article_id) VALUES ($user_id, $article_id)";
}
This works because if a checkbox is not checked, there is nothing for it in the $_POST array.
Hope that helps get your thinking flowing again! ~Ray