<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Affiliate Marketing Blog from Affiliate Project UK &#187; mysql</title>
	<atom:link href="http://www.affiliateproject.co.uk/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.affiliateproject.co.uk</link>
	<description></description>
	<lastBuildDate>Mon, 24 Oct 2011 09:45:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to pull product datafeeds using PHP and MYSQL and display into your Webpage</title>
		<link>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/</link>
		<comments>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 09:13:41 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[Affiliate Tools]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[How To's]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[datafeed]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.affiliateproject.co.uk/?p=541</guid>
		<description><![CDATA[

Affiliate Project recently received a comment on this post &#8211; Niche site launched using data feeds and decided to create this post to help any other affiliates with displaying product data feeds.
We initially struggled to get product data feeds working. We found it hard to find how to get this to work, so thought we [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.affiliateproject.co.uk%252Fpull-product-datafeeds-php-mysql-display-webpage%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22How%20to%20pull%20product%20datafeeds%20using%20PHP%20and%20MYSQL%20and%20display%20into%20your%20Webpage%22%20%7D);"></div>
<p style="text-align: justify;">Affiliate Project recently received a comment on this post &#8211; <a href="http://www.affiliateproject.co.uk/site-launched-wwwmaternityswimwearorguk/#comments">Niche site launched using data feeds</a> and decided to create this post to help any other affiliates with displaying product data feeds.</p>
<p style="text-align: justify;">We initially struggled to get product data feeds working. We found it hard to find how to get this to work, so thought we would document this on our blog and this could also help other affiliates.</p>
<p style="text-align: justify;">There was 3 basic steps to get the data feeds to be displayed on the page.</p>
<p style="text-align: justify;">Before you do this, you will need to download your data feeds and then create a new database using phpmyadmin (often from cpanel tools). Create the field names as per your datafeed or merchants datafeed.</p>
<p><strong>1st step:</strong></p>
<p style="text-align: justify;">Create a php page template. So in the php file you will specify template name, pull in the header and title, then when you login to wordpress and add a new page, you can specify this new page template (your_template_name).</p>
<p>EXAMPLE:<br />
<code>&lt;?php<br />
/*<br />
Template Name: your_template_name<br />
*/<br />
?&gt;</p>
<p>&lt;?php get_header(); ?&gt;</p>
<p>	&lt;div id=&quot;content&quot;&gt;</p>
<p>	&lt;span class=&quot;breadcrumbs&quot;&gt;Browse: &lt;strong&gt;&lt;a href=&quot;&lt;?php echo get_option(&#039;home&#039;); ?&gt;/&quot;&gt;Home&lt;/a&gt; &amp;raquo; Your Template Name&lt;/strong&gt;&lt;/span&gt;</p>
<p>	&lt;h2 class=&quot;title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;</p>
<p>&lt;?php<br />
</code><br />
<strong>2nd step:</strong></p>
<p style="text-align: justify;">Put the php code that has the mysql statements that query the database which holds the datafeed</p>
<p>EXAMPLE:<br />
<code>// Connect to Database<br />
$con = mysql_connect(&quot;localhost&quot;,&quot;database_name&quot;,&quot;database_password&quot;);<br />
if (!$con)<br />
  {<br />
  die(&#039;Could not connect: &#039; . mysql_error());<br />
  }</p>
<p>// Select the Database<br />
mysql_select_db(&quot;database_name&quot;, $con);</p>
<p>// Select the data from table_name<br />
$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;);<br />
</code></p>
<p><strong>3rd Step:</strong></p>
<p style="text-align: justify;">Display the data from the database in table format, then loop the products. After that close the connection and display the sidebar and the footer</p>
<p>EXAMPLE:<br />
<code>// Display the table<br />
echo &quot;&lt;table border=&#039;0&#039; cellspacing=&#039;16&#039;&gt;&quot;;</p>
<p>// Put results into table<br />
 $counter = 0;<br />
while($row = mysql_fetch_array($result))<br />
  {</p>
<p>echo &quot;&lt;td WIDTH=&#039;112&#039; align=&#039;left&#039; valign=&#039;top&#039;&gt;&lt;a href=\&quot;&quot; .$row[&#039;field_c&#039;] . &quot;\&quot;&gt;<br />
&lt;span class=&#039;producttable&#039;&gt;&lt;img width=&#039;140&#039; src=\&quot;&quot; . $row[&#039;field_d&#039;] . &quot;\&quot; border=1 alt=\&quot;&quot; . $row[&quot;field_d&quot;] . &quot;\&quot; title=\&quot;&quot; . $row[&quot;field_b&quot;] . &quot;\&quot;&gt;&lt;/span&gt;<br />
&lt;br&gt;&lt;span class=&#039;producttext&#039;&gt;$row[field_a]&lt;/span&gt;&lt;/br&gt;&lt;br&gt;$row[field_b]&lt;/br&gt;&lt;/span&gt;&lt;/a&gt;&quot;;<br />
echo &quot;&lt;br&gt;&lt;span class=&#039;producttext&#039;&gt;&lt;strong&gt;&amp;pound;$row[field_e]&lt;/strong&gt;&lt;/span&gt;&lt;/br&gt;&quot;;<br />
    $counter++; # increment count every iteration<br />
  if ( $counter % 3 == 0 )<br />
    {<br />
        echo &quot;&lt;tr /&gt;&quot;;<br />
  }<br />
  }<br />
  echo &quot;&lt;/td&gt;&quot;;<br />
echo &quot;&lt;/table&gt;&quot;;</p>
<p>// Disconnect from Database<br />
mysql_close($con);<br />
?&gt;<br />
&lt;/div&gt;<br />
&lt;?php get_sidebar() ?&gt;<br />
&lt;?php get_footer() ?&gt;<br />
</code></p>
<p style="text-align: justify;">You can style the output how you wish with css styling.</p>
<p style="text-align: justify;">w3schools.com is a great resource for website coding such as html / php / mysql.</p>
<p>Hope this helps other affiliates.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9605645641555579";
/* 468x60, created 7/29/09 */
google_ad_slot = "7518562531";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>

<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Did you find this article useful? If so share and enjoy:</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/&amp;title=How+to+pull+product+datafeeds+using+PHP+and+MYSQL+and+display+into+your+Webpage" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/&amp;title=How+to+pull+product+datafeeds+using+PHP+and+MYSQL+and+display+into+your+Webpage" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/&amp;title=How+to+pull+product+datafeeds+using+PHP+and+MYSQL+and+display+into+your+Webpage" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/&amp;title=How+to+pull+product+datafeeds+using+PHP+and+MYSQL+and+display+into+your+Webpage" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/&amp;t=How+to+pull+product+datafeeds+using+PHP+and+MYSQL+and+display+into+your+Webpage" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.affiliateproject.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.affiliateproject.co.uk/pull-product-datafeeds-php-mysql-display-webpage/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

