<?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>Chris Clarke&#039;s Blog &#187; Search Results  &#187;  results</title>
	<atom:link href="http://sorrowfulunfounded.com/search/results/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://sorrowfulunfounded.com</link>
	<description>Official Weblog of Christopher Clarke</description>
	<lastBuildDate>Thu, 10 Nov 2011 04:32:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>El Shaddai: Ascension of the Metatron Demo Impressions</title>
		<link>http://sorrowfulunfounded.com/blog/2011/04/16/el-shaddai-ascension-of-the-metatron-demo-impressions/</link>
		<comments>http://sorrowfulunfounded.com/blog/2011/04/16/el-shaddai-ascension-of-the-metatron-demo-impressions/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 03:31:15 +0000</pubDate>
		<dc:creator>Chris Clarke</dc:creator>
				<category><![CDATA[First Impressions]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[El Shaddai]]></category>
		<category><![CDATA[Ignition Entertainment]]></category>
		<category><![CDATA[Japanese]]></category>
		<category><![CDATA[PlayStation 3]]></category>
		<category><![CDATA[Xbox 360]]></category>

		<guid isPermaLink="false">http://sorrowfulunfounded.com/blog/2011/04/16/el-shaddai-ascension-of-the-metatron-demo-impressions/</guid>
		<description><![CDATA[I wasn’t sure what to expect from El Shaddai. Coming into the demo, I was greeted by beautiful environments more symbolic than realistic. I was instantly reminded by Okami, which while being more literal, was simular in its beauty, and sure enough I have learned that Okami’s character designer was leading the development of El [...]]]></description>
			<content:encoded><![CDATA[<p>I wasn’t sure what to expect from <a href="http://en.wikipedia.org/wiki/El_Shaddai:_Ascension_of_the_Metatron">El Shaddai</a>. Coming into the demo, I was greeted by beautiful environments more symbolic than realistic. I was instantly reminded by <a href="http://en.wikipedia.org/wiki/Okami">Okami</a>, which while being more literal, was simular in its beauty, and sure enough I have learned that Okami’s character designer was leading the development of El Shaddai.</p>
<p>The game has me playing as Enoch, a priest who is looking for seven fallen angels in order to prevent a great flood from wiping out man kind. </p>
<p>The gameplay is fairly fluid with two buttons assigned to attack and two to jump with a further two buttons assigned to purify your weapon and defend respectively. Various combinations can also change the nature of the attacks. At first, I had a little bit of difficulty landing attacks on the enemies and died fairly quickly but after I got used to the pace of the game and worked out the button combinations, I had much better results. I enjoyed that the games fodder enemies were not just few hit wonders but actually required a bit of work to defeat with careless button mashing being a sure fire way of being defeated.</p>
<p>The game also has side-scrolling platform elements. The standout feature of these sections are the waves which the tips of can be ridden by Enoch to transverse the levels. I am under the impression that these sections are being used to go between major game locations, somewhat similar to the side-scrolling sections of Disney’s <a href="http://en.wikipedia.org/wiki/Epic_Mickey">Epic Mickey</a>. </p>
<p>The El Shaddai: Ascension of the Metatron demo is available on the Japanese PlayStation Network and Xbox Live for gold subscribers. I played the PlayStation 3 version. The full game will be released April 28, 2011 in Japan. You can <a href="http://www.play-asia.com/SOap-23-83-kteo-71-bp-49-en-84-j-70-45ae.html">pre-order</a> at <a href="http://www.play-asia.com/SOap-23-83-kteo.html">Play-Asia.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sorrowfulunfounded.com/blog/2011/04/16/el-shaddai-ascension-of-the-metatron-demo-impressions/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Introduction to PHP: Hello World + MySQL</title>
		<link>http://sorrowfulunfounded.com/blog/2009/06/30/introduction-to-php-hello-world-mysql/</link>
		<comments>http://sorrowfulunfounded.com/blog/2009/06/30/introduction-to-php-hello-world-mysql/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 04:57:32 +0000</pubDate>
		<dc:creator>Chris Clarke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://sorrowfulunfounded.com/?p=403</guid>
		<description><![CDATA[This tutorial builds on the previous tutorial &#8211; Introduction to PHP: Hello World and as such, you should take that tutorial first if you have not already. In this tutorial, we are going to take our previous Hello World script, and store the date in a database. We will then add the last access time [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial builds on the previous tutorial &#8211; Introduction to <a href="http://sorrowfulunfounded.com/2009/06/introduction-to-php-hello-world/">PHP: Hello World</a> and as such, you should take that tutorial first if you have not already.</p>
<p>In this tutorial, we are going to take our previous Hello World script, and store the date in a database. We will then add the last access time to our original script.<span id="more-403"></span> We are going to use <a href="http://mysql.com">MySQL</a> in this tutorial. I will assume that you already have MySQL and <a href="http://phpmyadmin.net">phpMyAdmin</a> (or equivalent) installed.</p>
<p>The state of our script at the end of the last tutorial was as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Hello World. Today\'s date is '</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Our database table will consist of two fields, `ID`, and `current_timestamp`. Both will be of type, integer (INT). You should make `ID` a primary key, and auto_increment. `current_timestamp` can be left with the default options.</p>
<p>For your convenience, I will provide a SQL query to create the table.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`last_access`</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #ff0000;">`ID`</span> <span style="color: #993333; font-weight: bold;">INT</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">`current_timestamp`</span> <span style="color: #993333; font-weight: bold;">INT</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span>
<span style="color: #66cc66;">&#41;</span> ENGINE <span style="color: #66cc66;">=</span> InnoDB</pre></td></tr></table></div>

<p>You can run the above query in the SQL section of phpMyAdmin when viewing your database.</p>
<p>To connect to our database, we use two functions, <a href="http://au.php.net/mysql_connect">mysql_connect</a>, and <a href="http://au.php.net/manual/en/function.mysql-select-db.php">mysql_select_db</a>.</p>
<p>The first function, mysql_connect takes three parameters or arguments. These parameters are the host name (most of the time, localhost), and a username and password. These should have been provided by your web host. If you installed a server on your own computer, it is likely that username is root, with no password. We are going to place the mysql_connect function in a variable called $connection (be sure to change the parameters to suite your own specific situation):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'USERNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'PASSWORD'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Next, we need to use mysql_select_db to access our specific database. I&#8217;ve called mine date, but you may have called it something different. If you have, change as appropriate. mysql_select_db takes two parameters. These are the $connection variable we just set and the name of your database.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'date'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You can go ahead and place these functions at the top of our Hello World script.</p>
<p>Next, we are going to use the <a href="http://us.php.net/mysql_query">mysql_query</a> function to insert the current time into our new database table. mysql_query only takes one parameter and this is an SQL statement. SQL stands for structured query language and is how we interact with our database within our applications. I won&#8217;t go into detail about SQL at this time, but for now, <a href="http://www.w3schools.com">W3Schools</a> offers <a href="http://www.w3schools.com/sql/default.asp">a decent introduction</a>.</p>
<p>Within our query, we will also use PHP&#8217;s time function. This function takes no parameters. It returns the current UNIX time stamp which is the number of seconds since the start of 1970. </p>
<p>Place the following in your script after the connection functions, and run it.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT INTO `last_access` SET `current_timestamp` = \''</span><span style="color: #339933;">.</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now, we are going to use the mysql_query function again to retrieve the last access time. This time we will place the mysql_query function into a variable, so we can access the results.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT `current_timestamp` FROM `last_access` ORDER BY `current_timestamp` DESC LIMIT 1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now, we want to be able to retrieve the data our SELECT query is retrieving. We can do this with, mysql_fetch_assoc. It takes one parameter, and this is our query variable which we named $result. Like mysql_query, we will also place this into a variable.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Place the SELECT query before the INSERT query but after the connection information.</p>
<p>Now, all the pieces are in place to put our final script together.</p>
<p>Your script should look like this at this point:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'USERNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'PASSWORD'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'date'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT `current_timestamp` FROM `last_access` ORDER BY `current_timestamp` DESC LIMIT 1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT INTO `last_access` SET `current_timestamp` = \''</span><span style="color: #339933;">.</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Hello World. Today\'s date is '</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now, we are going to add the current hour, minute and second to our date function in our echo language construct. The letters for these are h (hour), i (i since m is reserved for month, the current minute) and s (seconds).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Hello World. Today\'s date is '</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y h:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Next, we want to display the last access date. To do this, we are going to add another echo language construct. Since row only returned one piece of data due to LIMIT 1, we can use it just like we would an array (we will discuss arrays in a later tutorial). For now, all you need to know is that they are used like variables but can store more then one piece of information.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' This script was last accessed at  '</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y h:i:s'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'current_timestamp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You will notice this date function is taking a second parameter. This changes the output of date from the current time/date to the time and date which it was when the timestamp was recorded. </p>
<p>Our final script looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'USERNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'PASSWORD'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'date'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT `current_timestamp` FROM `last_access` ORDER BY `current_timestamp` DESC LIMIT 1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT INTO `last_access` SET `current_timestamp` = \''</span><span style="color: #339933;">.</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Hello World. Today\'s date is '</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y h:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' This script was last accessed at  '</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d/m/Y h:i:s'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'current_timestamp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>So that concludes this tutorial. As usual, comments, suggestions and most importantly, questions, are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://sorrowfulunfounded.com/blog/2009/06/30/introduction-to-php-hello-world-mysql/feed/</wfw:commentRss>
		<slash:comments>84</slash:comments>
		</item>
	</channel>
</rss>

