<?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>PHP Tutorials Code Snippets and Php Tips &#187; views count</title>
	<atom:link href="http://readytousesolutions.com/phpblog/tag/views-count/feed/" rel="self" type="application/rss+xml" />
	<link>http://readytousesolutions.com/phpblog</link>
	<description>PHP tutorials - Examples of the most useful scripts</description>
	<lastBuildDate>Thu, 23 Sep 2010 06:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP Tutorial : Simple views counter script</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-simple-views-counter-script/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-simple-views-counter-script/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 23:03:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[count views]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[counter script]]></category>
		<category><![CDATA[number of views]]></category>
		<category><![CDATA[php count]]></category>
		<category><![CDATA[php counter]]></category>
		<category><![CDATA[php views counter]]></category>
		<category><![CDATA[views count]]></category>
		<category><![CDATA[views counter]]></category>
		<category><![CDATA[views script]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=55</guid>
		<description><![CDATA[Hi, In this php tutorial you will learn the simple way to build a script which counts how many times a page is viewed. For this, we can use a mysql database table and a simple php script. &#60;?php $pagename &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-simple-views-counter-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>In this php tutorial you will learn the simple way to build a script which counts how many times a page is viewed. For this, we can use a mysql database table and a simple php script.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
$pagename <span class="phpOperator">=</span> <span class="phpScriptVar">$_SERVER</span><span class="phpOperator">[</span><span class="phpString">'PHP_SELF'</span><span class="phpOperator">]</span><span class="phpText">;</span>
$sql <span class="phpOperator">=</span> <span class="phpString">"select * from mysqltable where page <span class="phpOperator">=</span> <span class="phpString">'$pagename'</span>"</span><span class="phpText">;</span>
$rs <span class="phpOperator">=</span> <span class="phpFunction">mysql_query</span><span class="phpOperator">(</span>$sql<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
if<span class="phpOperator">(</span></span>$rs<span class="phpOperator">)</span> <span class="phpOperator">{</span>
$row<span class="phpOperator">=</span>@<span class="phpFunction">mysql_fetch_object</span><span class="phpOperator">(</span>$rs<span class="phpOperator">)</span><span class="phpText">;</span>
$counter <span class="phpOperator">=</span> $row<span class="phpOperator">-<span class="phpOperator">&gt;</span></span><span class="htmlText">counterfield</span><span class="phpText">;</span>
<span class="phpComment">//update the stats,<span class="phpKeyword"> if </span>they exits
</span>
$counter <span class="phpOperator">=</span> <span class="phpString">"".($counter+1).""</span><span class="phpText">;</span>
$qry <span class="phpOperator">=</span> <span class="phpFunction">mysql_query</span><span class="phpOperator">(</span><span class="phpString">"updated tablename set counterfield <span class="phpOperator">=</span> <span class="phpString">'$counter'</span><span class="htmlText"> where id </span><span class="phpOperator">=</span> <span class="phpString">'$row<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>id'</span>"</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword"><span class="phpOperator">}</span><span class="htmlText">else</span><span class="phpOperator">{</span></span>
<span class="htmlText">
print </span><span class="phpFunction">mysql_error</span><span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-simple-views-counter-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

