[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

01/09/2009 at 01:41AM PST, ID: 24037836
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Insert RSS into mysql Database

Asked by rhiannon1 in Voice XML, Slax / Slackware Linux, RSS

Tags: PHP, MYSQL, XML

I 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->title</a>), but how do i save to the database, and also pull out and save the whole document body. i.e http://www.medicalnewstoday.com/printerfriendlynews.php?newsid=134827.

Really stuck on this, I have got so far, now just hit the brick wall : (   any ideas ?

Thank You.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
<?PHP
 
require_once("dbCon/dbcon.php");
 
try {
/*  query the database */
$db = getCon();
 
/* Parse XML from  http://www.medicalnewstoday.com */
$RSS_DOC = simpleXML_load_file('http://www.medicalnewstoday.com/rss/smoking.xml');
 
/* Get title, link, managing editor, and copyright from the document  */
$rss_title = $RSS_DOC->channel->title;
$rss_link = $RSS_DOC->channel->link;
$rss_editor = $RSS_DOC->channel->managingEditor;
$rss_copyright = $RSS_DOC->channel->copyright;
 
//Loop through each item in the RSS document
 
foreach($RSS_DOC->channel->item as $RSSitem) {
// modify string from articles  //
$friendly = str_replace(array('.php', 'articles/'), array('', 'printerfriendlynews.php?newsid='), $RSSitem->link);
 
//  form //
$page->addToContent("<form action='rssNeuroScience.php' method='post' />");
	
	//The variable $RSSitem will hold a different item for each loop
		$page->addToContent("<b><a href='$friendly'>$RSSitem->title</a></b><br /><br />");
		$page->addToContent("<b>$RSSitem->pubDate</b><br /><br />");
		$page->addToContent("$RSSitem->description<br /><br />");
		$page->addToContent("<input name='cBox' type='checkbox' value='cBox'/><br />");
		//$page->addaddToContent("-------------------------------------------------------------<br />");
}
$page->addToContent("<input type='submit' value='submit'/></form>");
// End of form //
 
?>
[+][-]01/09/09 08:55 AM, ID: 23337470

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Voice XML, Slax / Slackware Linux, RSS
Tags: PHP, MYSQL, XML
Sign Up Now!
Solution Provided By: Ray_Paseur
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01/13/09 09:01 AM, ID: 23364794

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625