<?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: Creating a PHP CMS – Part 4</title>
	<atom:link href="http://fwebde.com/web-design/creating-a-php-cms-part-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/</link>
	<description>Helping people to make fantastic websites, whether you are a designer, a developer, or someone just who loves websites.</description>
	<lastBuildDate>Fri, 23 Jul 2010 12:14:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-713</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Mon, 18 Jan 2010 03:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-713</guid>
		<description>I agree that this is a little bit confusing. I wrote this a long time ago as a reference for myself. And now I&#039;m wondering &quot;What was I thinking?&quot; :)

When I say put something in something else, I usually mean in between curly brackets { }

Each line of code I show will generally go in the order in which they are shown. For example:

&lt;pre lang=&quot;PHP&quot;&gt;
function title() {
    if ($_GET[&#039;id&#039;]) {
        $pageID = (int) $_GET[&#039;id&#039;];

        $result = mysql_query(&quot;SELECT title FROM pages WHERE id=&#039;$pageID&#039;&quot;);
        $row = mysql_fetch_array($result);
		
        echo $row[&#039;title&#039;];
    } else {
        $result = mysql_query(&quot;SELECT value FROM settings WHERE name=&#039;homeTitle&#039;&quot;);
        $row = mysql_fetch_array($result);
		
        echo $row[&#039;value&#039;];
    }
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I agree that this is a little bit confusing. I wrote this a long time ago as a reference for myself. And now I'm wondering "What was I thinking?" :)</p>
<p>When I say put something in something else, I usually mean in between curly brackets { }</p>
<p>Each line of code I show will generally go in the order in which they are shown. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$pageID</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</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;">&quot;SELECT title FROM pages WHERE id='<span style="color: #006699; font-weight: bold;">$pageID</span>'&quot;</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: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <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;">&quot;SELECT value FROM settings WHERE name='homeTitle'&quot;</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: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Kia</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-712</link>
		<dc:creator>Kia</dc:creator>
		<pubDate>Mon, 18 Jan 2010 01:49:53 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-712</guid>
		<description>I&#039;m sorry but this is confusing.  After you say put this code in for the function title()
 
you don&#039; t say where to put anything else.  You say put this in the if block- but what do you mean? i think what would help too, is that at the end of each lesson you show an overall of what our code should look like after that lesson.   You are doing a great job, there is just a little confusion with some things, and I cannot move forward.</description>
		<content:encoded><![CDATA[<p>I'm sorry but this is confusing.  After you say put this code in for the function title()</p>
<p>you don' t say where to put anything else.  You say put this in the if block- but what do you mean? i think what would help too, is that at the end of each lesson you show an overall of what our code should look like after that lesson.   You are doing a great job, there is just a little confusion with some things, and I cannot move forward.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-404</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Thu, 05 Nov 2009 00:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-404</guid>
		<description>@kt: Thanks for pointing that out. I forgot a quote in the pre tag.</description>
		<content:encoded><![CDATA[<p>@kt: Thanks for pointing that out. I forgot a quote in the pre tag.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kt</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-403</link>
		<dc:creator>kt</dc:creator>
		<pubDate>Wed, 04 Nov 2009 20:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-403</guid>
		<description>after this section, there is no code.  looks like a &lt;pre&gt; tag is not closed in your html? :
Page Title

Paste the code inside of the title function into the pageTitle function. Inside the else section, replace &#039;homeTitle&#039; in the MySQL query with &#039;homePage&#039;, and delete the line containing

echo $row[&#039;value&#039;];

and add in

*** NOTHING HERE***</description>
		<content:encoded><![CDATA[<p>after this section, there is no code.  looks like a &lt;pre&gt; tag is not closed in your html? :<br />
Page Title</p>
<p>Paste the code inside of the title function into the pageTitle function. Inside the else section, replace 'homeTitle' in the MySQL query with 'homePage', and delete the line containing</p>
<p>echo $row['value'];</p>
<p>and add in</p>
<p>*** NOTHING HERE***</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-164</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Sat, 05 Sep 2009 17:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-164</guid>
		<description>Duane: What about config.php? Make sure that your database user has proper permissions for the database.</description>
		<content:encoded><![CDATA[<p>Duane: What about config.php? Make sure that your database user has proper permissions for the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duane</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-163</link>
		<dc:creator>Duane</dc:creator>
		<pubDate>Sat, 05 Sep 2009 16:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-163</guid>
		<description>the value is correct its pretty much a copy and paste from your tutorial.</description>
		<content:encoded><![CDATA[<p>the value is correct its pretty much a copy and paste from your tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-162</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Sat, 05 Sep 2009 15:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-162</guid>
		<description>Duane: What is the value of $result? It looks like that variable is the problem. Or it could be a problem with the database.

Also, try checking the database in config.php, and make sure everything is correct.</description>
		<content:encoded><![CDATA[<p>Duane: What is the value of $result? It looks like that variable is the problem. Or it could be a problem with the database.</p>
<p>Also, try checking the database in config.php, and make sure everything is correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duane</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-161</link>
		<dc:creator>Duane</dc:creator>
		<pubDate>Sat, 05 Sep 2009 12:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-161</guid>
		<description>ok, i&#039;ve done that now, but for some reason its having problems connecting to the database

$row = mysql_fetch_array($result); has an error :S

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/paganc/public_html/Duane-Folder/functions.php on line 23


I used the script in the zip file. and get that error.</description>
		<content:encoded><![CDATA[<p>ok, i've done that now, but for some reason its having problems connecting to the database</p>
<p>$row = mysql_fetch_array($result); has an error :S</p>
<p>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/paganc/public_html/Duane-Folder/functions.php on line 23</p>
<p>I used the script in the zip file. and get that error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bannatyne</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-137</link>
		<dc:creator>Eric Bannatyne</dc:creator>
		<pubDate>Thu, 03 Sep 2009 18:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-137</guid>
		<description>Duane: It looks like a syntax error. If you are comparing the values, &#039;$homeTitleID = (int) $_GET[&#039;id&#039;]&#039; needs to be wrapped in parentheses, and the &#039;=&#039; needs to be &#039;==&#039;, because &#039;=&#039; is an assignment operator, and &#039;==&#039; is a comparison operator.

You can check Part 7, because there is a link to download the entire project, and you can take a look at functions.php if you are not sure what to do.</description>
		<content:encoded><![CDATA[<p>Duane: It looks like a syntax error. If you are comparing the values, '$homeTitleID = (int) $_GET['id']' needs to be wrapped in parentheses, and the '=' needs to be '==', because '=' is an assignment operator, and '==' is a comparison operator.</p>
<p>You can check Part 7, because there is a link to download the entire project, and you can take a look at functions.php if you are not sure what to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duane</title>
		<link>http://fwebde.com/web-design/creating-a-php-cms-part-4/comment-page-1/#comment-136</link>
		<dc:creator>Duane</dc:creator>
		<pubDate>Thu, 03 Sep 2009 18:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://fwebde.com/?p=301#comment-136</guid>
		<description>Oops, erm it didn&#039;t paste everything :( 

erm, if $homeTitleID = (int) $_GET[&#039;id&#039;]; is on line 14.</description>
		<content:encoded><![CDATA[<p>Oops, erm it didn't paste everything :( </p>
<p>erm, if $homeTitleID = (int) $_GET['id']; is on line 14.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
