<?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>Sidewaysgravity Blog &#187; PHP</title>
	<atom:link href="http://blog.sidewaysgravity.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sidewaysgravity.com</link>
	<description>How else can you explain running into walls?</description>
	<lastBuildDate>Sun, 02 Oct 2011 15:40:51 +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 error: expecting T_PAAMAYIM_NEKUDOTAYIM</title>
		<link>http://blog.sidewaysgravity.com/2010/05/php-error-expecting-t_paamayim_nekudotayim/</link>
		<comments>http://blog.sidewaysgravity.com/2010/05/php-error-expecting-t_paamayim_nekudotayim/#comments</comments>
		<pubDate>Mon, 10 May 2010 14:42:50 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.sidewaysgravity.com/?p=340</guid>
		<description><![CDATA[I ran across this error the other day while setting up a nested foreach loop. When looking at the error logs all I found was expecting T_PAAMAYIM_NEKUDOTAYIM. Which was not very helpful. If you find that you have this error, try looking for a missing dollar sign &#8220;$&#8221; on one of your variables. Hope this [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across this error the other day while setting up a nested foreach loop. When looking at the error logs all I found was expecting T_PAAMAYIM_NEKUDOTAYIM. Which was not very helpful. If you find that you have this error, try looking for a missing dollar sign &#8220;$&#8221; on one of your variables.</p>
<p>Hope this helps, happy coding!</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=PHP+error%3A+expecting+T_PAAMAYIM_NEKUDOTAYIM+http%3A%2F%2Fblog.sidewaysgravity.com%2F%3Fp%3D340" title="Post to Twitter"><img class="nothumb" src="http://blog.sidewaysgravity.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=PHP+error%3A+expecting+T_PAAMAYIM_NEKUDOTAYIM+http%3A%2F%2Fblog.sidewaysgravity.com%2F%3Fp%3D340" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sidewaysgravity.com/2010/05/php-error-expecting-t_paamayim_nekudotayim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting A default image with PHPThumb</title>
		<link>http://blog.sidewaysgravity.com/2009/08/setting-a-default-image-with-phpthumb/</link>
		<comments>http://blog.sidewaysgravity.com/2009/08/setting-a-default-image-with-phpthumb/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 03:26:38 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpThumb]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.sidewaysgravity.com/?p=311</guid>
		<description><![CDATA[For one of the larger projects that I work on, I use phpThumb, which will create a thumbnail of the requested image and cache it for fast downloads. This is great when you have a large number of images that will be viewed at various sizes and you dont want to export all the various [...]]]></description>
			<content:encoded><![CDATA[<p>For one of the larger projects that I work on, I use phpThumb, which will create a thumbnail of the requested image and cache it for fast downloads. This is great when you have a large number of images that will be viewed at various sizes and you dont want to export all the various sizes.</p>
<p>One of the problems I ran into recently is setting a default image that will appear if for some reason your source file cannot be located. When you are pulling images from a separate provider, this can become a concern.</p>
<p>PhpThumb has made this easy as their is a setting in the config file as shown below.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-312" title="phpthumbconfig" src="http://blog.sidewaysgravity.com/wp-content/uploads/2009/08/phpthumbconfig.png" alt="phpthumbconfig" width="436" height="95" /></p>
<p>All you have to do is add the local path to the file you want as a default into the config and then to test it you can set phpThumb to attempt to load a bad source file and it should display your image. If you are having issues seeing the file, make sure that the names match up, and that you have a forward slash before the path. You can also try doing an absolute path with the entire url to the image.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Setting+A+default+image+with+PHPThumb+http%3A%2F%2Fblog.sidewaysgravity.com%2F%3Fp%3D311" title="Post to Twitter"><img class="nothumb" src="http://blog.sidewaysgravity.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Setting+A+default+image+with+PHPThumb+http%3A%2F%2Fblog.sidewaysgravity.com%2F%3Fp%3D311" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sidewaysgravity.com/2009/08/setting-a-default-image-with-phpthumb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reuse your Select statements with mysql_data_seek( )</title>
		<link>http://blog.sidewaysgravity.com/2009/01/reuse-your-select-statements-with-mysql_data_seek/</link>
		<comments>http://blog.sidewaysgravity.com/2009/01/reuse-your-select-statements-with-mysql_data_seek/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 05:37:31 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql_data_seek()]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.sidewaysgravity.com/?p=109</guid>
		<description><![CDATA[This function has come in very handy with the developement of this site. You can use this function to set the data pointer to a certain row within your result that you recieve from a database function, in my case, mysql_query(). There are a couple reasons you would want to use the mysql_data_seek(). One would [...]]]></description>
			<content:encoded><![CDATA[<p>This function has come in very handy with the developement of this site. You can use this function to set the data pointer to a certain row within your result that you recieve from a database function, in my case, mysql_query().</p>
<p>There are a couple reasons you would want to use the mysql_data_seek(). One would be to return to the first row returned from the database, or it could be used to return to any row. There are also other uses for this function but to keep it simple I will just talk about the first.</p>
<p>The following code is a standard mysql query created by dreamweaver.</p>
<p><code>mysql_select_db($database, $connection);<br />
$query="SELECT * FROM tables;<br />
$resource=mysql_query($query, $connection) or die(mysql_error());<br />
$row_recordset= mysql_fetch_assoc($resource);<br />
$totalRows_recordset = mysql_num_rows($resource);</code></p>
<p>When you request information from the database it is stored as a resource. You can then pull from that resource with the mysql_fetch_assoc($resource). You can also use other functions such as mysql_fetch_row($resource).</p>
<p>PHP handles a resource very similar to reading a file. As PHP reads from the resource, it marks its place, much like earmarking a page in a book PHP remembers the last spot that was read from the resource. When you get to the last page of the book, you turn back to page one, and when you get to the last of the resource you have to set the pointer back to the beginning.</p>
<p><code>mysql_data_seek("$resource",0);<br />
$row_recordset=mysql_fetch_assoc($resource);</code></p>
<p>The mysql_data_seek() uses two values to accomplish this.The first value &#8220;$resource&#8221; is exactly what it says it is, the resource of your mysql select statement. The second is a numeric value of where you want to move the pointer or bookmark for that resource. The next time you get a value from the resource it will be from the new location of the pointer.</p>
<p>An important note if you are using dreamweaver. As you saw earlier in the code, dreamweaver initially sets $row_resource. With it initially set, you can use a do while loop so that the first instance is set and each reoccurring instance is set by the while statement. This is why after using the mysql_data_seek, I re-assigned $row_resource with the next value after the dataseek, in this case setting it back to the first value from the mysql select statement.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Reuse+your+Select+statements+with+mysql_data_seek%28+%29+http%3A%2F%2Fblog.sidewaysgravity.com%2F%3Fp%3D109" title="Post to Twitter"><img class="nothumb" src="http://blog.sidewaysgravity.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Reuse+your+Select+statements+with+mysql_data_seek%28+%29+http%3A%2F%2Fblog.sidewaysgravity.com%2F%3Fp%3D109" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sidewaysgravity.com/2009/01/reuse-your-select-statements-with-mysql_data_seek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

