<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to pull product datafeeds using PHP and MYSQL and display into your Webpage</title>
	<atom:link href="http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/</link>
	<description></description>
	<lastBuildDate>Sat, 11 Jun 2011 19:15:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gary</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-568</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Sun, 17 Jan 2010 08:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-568</guid>
		<description>Hi Tom,

Good idea and thanks for sharing. Glad you liked the post and it seems to have helped quite a few people out there. 

Cheers
Gary</description>
		<content:encoded><![CDATA[<p>Hi Tom,</p>
<p>Good idea and thanks for sharing. Glad you liked the post and it seems to have helped quite a few people out there. </p>
<p>Cheers<br />
Gary</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-567</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sat, 16 Jan 2010 09:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-567</guid>
		<description>Great script - thanks for this!

I was worried about having to edit lots of pages if i ever wanted to change the layout at all. So I&#039;ve done a bit of tinkering, and rather than hard-coding the sql query in to the page template and having a template for each page, I&#039;ve created a new custom field for pages in Wordpress, called sql-query, to store the sql in. You can then retrieve the query from the wordpress database to put in to your script as follows:-

Replace this:-

// Select the data from table_name
$result = mysql_query(&quot;SELECT field_a, field_b, field_c, field_d, field_e FROM table_name WHERE field_f=&#039;category_name&#039;&quot;);

With:-

// Select the data from table_name
$result = mysql_query(get_post_meta($post-&gt;ID, &quot;sql_query&quot;, true));

Adding a custom field to a wordpress page is really easy... if you edit a page, under the main html editor for the content, there&#039;s a section called Custom Fields. Just enter &#039;sql-query&#039; in the Name box, and enter your sql query in to the value. Press Add and that&#039;s it. The next time you want to add the custom field to a page, you don&#039;t need to type the name in, just select it from the drop down box instead. Simples! 

This means I now only need 1 template and can create as many pages as I like from that page, but still with a different selection of products from the datafeed - it&#039;s great if i ever need to change the layout of the page - only one template to edit!

Taking it a bit further, I was a bit conscious about having duplicate content on my page as it would be purely data from the datafeed which will no doubt be shown on thousands of affiliates&#039; sites worldwide.

So I then went about putting the original page content back in to the template, so that I can add text to the page as you would with any normal wordpress page. 

The code you need to enter in to your template will be slightly different depending on your theme, but it should start something like this:-



You can put it in the template wherever you like - before the feed or after the feed - up to you. But if you then write perhaps 200-300 words about that page, it should give Google the unique content it likes to see.

This post really helped me, so I hope this helps others!

Tom</description>
		<content:encoded><![CDATA[<p>Great script &#8211; thanks for this!</p>
<p>I was worried about having to edit lots of pages if i ever wanted to change the layout at all. So I&#8217;ve done a bit of tinkering, and rather than hard-coding the sql query in to the page template and having a template for each page, I&#8217;ve created a new custom field for pages in Wordpress, called sql-query, to store the sql in. You can then retrieve the query from the wordpress database to put in to your script as follows:-</p>
<p>Replace this:-</p>
<p>// Select the data from table_name<br />
$result = mysql_query(&#8221;SELECT field_a, field_b, field_c, field_d, field_e FROM table_name WHERE field_f=&#8217;category_name&#8217;&#8221;);</p>
<p>With:-</p>
<p>// Select the data from table_name<br />
$result = mysql_query(get_post_meta($post-&gt;ID, &#8220;sql_query&#8221;, true));</p>
<p>Adding a custom field to a wordpress page is really easy&#8230; if you edit a page, under the main html editor for the content, there&#8217;s a section called Custom Fields. Just enter &#8217;sql-query&#8217; in the Name box, and enter your sql query in to the value. Press Add and that&#8217;s it. The next time you want to add the custom field to a page, you don&#8217;t need to type the name in, just select it from the drop down box instead. Simples! </p>
<p>This means I now only need 1 template and can create as many pages as I like from that page, but still with a different selection of products from the datafeed &#8211; it&#8217;s great if i ever need to change the layout of the page &#8211; only one template to edit!</p>
<p>Taking it a bit further, I was a bit conscious about having duplicate content on my page as it would be purely data from the datafeed which will no doubt be shown on thousands of affiliates&#8217; sites worldwide.</p>
<p>So I then went about putting the original page content back in to the template, so that I can add text to the page as you would with any normal wordpress page. </p>
<p>The code you need to enter in to your template will be slightly different depending on your theme, but it should start something like this:-</p>
<p>You can put it in the template wherever you like &#8211; before the feed or after the feed &#8211; up to you. But if you then write perhaps 200-300 words about that page, it should give Google the unique content it likes to see.</p>
<p>This post really helped me, so I hope this helps others!</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Stauffer</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-561</link>
		<dc:creator>Josh Stauffer</dc:creator>
		<pubDate>Mon, 28 Dec 2009 18:44:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-561</guid>
		<description>This is awesome stuff guys! I&#039;ve often wondered the easiest way to work with data feeds and this seems to be it. This is definitely something I am comfortable tinkering with so thanks for sharing this info!</description>
		<content:encoded><![CDATA[<p>This is awesome stuff guys! I&#8217;ve often wondered the easiest way to work with data feeds and this seems to be it. This is definitely something I am comfortable tinkering with so thanks for sharing this info!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Affiliate Project work with Affiliate Newbie on niche sites &#124; Affiliate Marketing Blog from Affiliate Project UK</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-557</link>
		<dc:creator>Affiliate Project work with Affiliate Newbie on niche sites &#124; Affiliate Marketing Blog from Affiliate Project UK</dc:creator>
		<pubDate>Mon, 21 Dec 2009 11:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-557</guid>
		<description>[...] up his product data feeds into his niche websites using PHP and MYSQL. He found us through our How to pull product datafeeds using PHP and MySQL and display into your Webpage post.  Since helping Stuart with some basic guidance,he has gone on and very quickly figured out [...]</description>
		<content:encoded><![CDATA[<p>[...] up his product data feeds into his niche websites using PHP and MYSQL. He found us through our How to pull product datafeeds using PHP and MySQL and display into your Webpage post.  Since helping Stuart with some basic guidance,he has gone on and very quickly figured out [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-556</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Thu, 10 Dec 2009 18:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-556</guid>
		<description>Cheers bud, not sure my script would be any better than yours though, but drop me a line later and i&#039;ll link you to the page i&#039;m working on.

Think i&#039;ve figured out a way to get merchant logos displaying so will implement and test that out later too.</description>
		<content:encoded><![CDATA[<p>Cheers bud, not sure my script would be any better than yours though, but drop me a line later and i&#8217;ll link you to the page i&#8217;m working on.</p>
<p>Think i&#8217;ve figured out a way to get merchant logos displaying so will implement and test that out later too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-555</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Thu, 10 Dec 2009 18:11:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-555</guid>
		<description>Glad you managed to get it working stuart. Would be good to compare scripts at some point mate. I look forward to seeing this updated in your site and I must say its a very nice design there.</description>
		<content:encoded><![CDATA[<p>Glad you managed to get it working stuart. Would be good to compare scripts at some point mate. I look forward to seeing this updated in your site and I must say its a very nice design there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-554</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Thu, 10 Dec 2009 17:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-554</guid>
		<description>I just wanted to leave a message to say a big thankyou for this post and follow up replies. Using this as a basis i managed to eventually display products from one database table on a test page, then after further research and tinkering i am now at a point where i&#039;m displaying products from 4 different feeds, all arranged by price and a few other condtions, albeit heavily modified from your original example now.

I&#039;m nearly ready to go site-wide with it, just a bit more tarting up to do and then it will just be a case of finding out how to automate a bit more the updating of the database.

I&#039;ve thoroughly enjoyed the whole challenge and want to say thanks for the inspiration to make a start!</description>
		<content:encoded><![CDATA[<p>I just wanted to leave a message to say a big thankyou for this post and follow up replies. Using this as a basis i managed to eventually display products from one database table on a test page, then after further research and tinkering i am now at a point where i&#8217;m displaying products from 4 different feeds, all arranged by price and a few other condtions, albeit heavily modified from your original example now.</p>
<p>I&#8217;m nearly ready to go site-wide with it, just a bit more tarting up to do and then it will just be a case of finding out how to automate a bit more the updating of the database.</p>
<p>I&#8217;ve thoroughly enjoyed the whole challenge and want to say thanks for the inspiration to make a start!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-553</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 10 Dec 2009 08:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-553</guid>
		<description>Hi Darren, for different network feeds you will need to put their datafeeds into different tables in your mysql database. Try to keep the main field names to same as the other tables because when it comes to displaying these these $rows from php echo it will make things easier. Also not sure that you can union with different field names!

Also the field names don&#039;t need to match the names of the csv columns from the datafeed. Only the number of fields need to match the number of columns.

Hope this makes sense
Cheers
Gary</description>
		<content:encoded><![CDATA[<p>Hi Darren, for different network feeds you will need to put their datafeeds into different tables in your mysql database. Try to keep the main field names to same as the other tables because when it comes to displaying these these $rows from php echo it will make things easier. Also not sure that you can union with different field names!</p>
<p>Also the field names don&#8217;t need to match the names of the csv columns from the datafeed. Only the number of fields need to match the number of columns.</p>
<p>Hope this makes sense<br />
Cheers<br />
Gary</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-552</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Wed, 09 Dec 2009 22:40:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-552</guid>
		<description>Hi Gary

Thanks for the update.  I will take a look at the reference provided.
How do you deal with different networks feeds, I assume they would be in different formats and therefore not fit in the table created?

Feel free to email me if its easier.

Thanks
Darren</description>
		<content:encoded><![CDATA[<p>Hi Gary</p>
<p>Thanks for the update.  I will take a look at the reference provided.<br />
How do you deal with different networks feeds, I assume they would be in different formats and therefore not fit in the table created?</p>
<p>Feel free to email me if its easier.</p>
<p>Thanks<br />
Darren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/comment-page-1/#comment-551</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 09 Dec 2009 10:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541#comment-551</guid>
		<description>Hi Darren, sorry for the late reply, its been so busy, getting some new sites down and doing lots of content for our sites.

I used this site as a reference for understanding the different fields: 
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html

You will just need to create field names and match the number of fields to the number of columns from your datafeed csv file from the network. You don&#039;t need all the network datafeed columns though.

You will also need to make sure the order of the fields match to make it easy to automate updating the table.

Hope this helps
Gary</description>
		<content:encoded><![CDATA[<p>Hi Darren, sorry for the late reply, its been so busy, getting some new sites down and doing lots of content for our sites.</p>
<p>I used this site as a reference for understanding the different fields:<br />
<a href="http://dev.mysql.com/doc/refman/5.1/en/string-functions.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/string-functions.html</a></p>
<p>You will just need to create field names and match the number of fields to the number of columns from your datafeed csv file from the network. You don&#8217;t need all the network datafeed columns though.</p>
<p>You will also need to make sure the order of the fields match to make it easy to automate updating the table.</p>
<p>Hope this helps<br />
Gary</p>
]]></content:encoded>
	</item>
</channel>
</rss>

