<?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>Freelance PHP Developer &#187; php freelancer</title>
	<atom:link href="http://freelance-php-developer.phpmysql.co.za/tag/php-freelancer/feed/" rel="self" type="application/rss+xml" />
	<link>http://freelance-php-developer.phpmysql.co.za</link>
	<description>Freelance PHP Developer &#124; South Africa</description>
	<lastBuildDate>Sat, 07 Jan 2012 06:42:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Working as a freelancer</title>
		<link>http://freelance-php-developer.phpmysql.co.za/2010/07/working-as-a-freelancer/</link>
		<comments>http://freelance-php-developer.phpmysql.co.za/2010/07/working-as-a-freelancer/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 04:48:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freelance Web Developer]]></category>
		<category><![CDATA[freelance web developer]]></category>
		<category><![CDATA[Freelance work]]></category>
		<category><![CDATA[php freelancer]]></category>

		<guid isPermaLink="false">http://freelance-php-developer.phpmysql.co.za/?p=106</guid>
		<description><![CDATA[Freelance work is not for everyone. Freelancing, or working for specific clients on specific projects, comes with distinct advantages and disadvantages. Sometimes people will not know if they are cut out for freelance work until they actually start working. Others may only need to think about a freelance lifestyle to know that it is not [...]


No related posts.

Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Freelance work is not for everyone. Freelancing, or working for specific clients on specific projects, comes with distinct advantages and disadvantages. Sometimes people will not know if they are cut out for freelance work until they actually start working. Others may only need to think about a freelance lifestyle to know that it is not for them.</p>
<p>If you are considering freelance work, make sure that you think through the many advantages and disadvantages of freelancing before making any decisions.</p>
<p>Advantages Of Freelance Work<br />
There are many advantages of freelance work. One of the greatest advantages of freelance work is the ability to work from home. No more need for work clothing, commuting time, commuting expenses, sharing an office, working in a cubicle or inane chats during tea breaks.</p>
<p>Another great advantage is the ability to be your own boss. No more being assigned projects you don’t want, having to work with team-mates you don’t respect or worrying about who is looking over your shoulder. Also, freelancing allows you to use a variety of skills on a variety of projects all at the same time. This can be fantastic for individuals who enjoy diverse tasks and topics and work best when they have multiple balls to keep in the air.</p>
<p>Individuals who work well under pressure and are well organised may find freelancing a great idea as they take on all responsibilities for every project, something that is not for the faint of heart!</p>
<p>Disadvantages Of Freelance Work<br />
Freelancing does have its disadvantages as well. One great disadvantage it is that it is a very isolated way to work. When you work from home it is easy to be alone for hours and even days on end. Contact with others often comes in the form of phone calls, faxes or emails so a freelance must often make a point to leave the house and see other people.</p>
<p>Another disadvantage is having to be your own boss. Freelancing can be a nightmare for people who are not good with deadlines, following up on projects, collecting payments or enforcing contract clauses. Also, freelance work necessarily requires a lot of paperwork. Contracts, invoices, client communication, marketing supplies – all of this must be organised and used effectively by a freelance worker. People who are inherently uncomfortable with such organisation often find freelance work a challenge, particularly when it comes to organising a client folder or getting paperwork ready for taxes.</p>
<p>Finally, freelance work is often described as a feast or famine profession. This can make it hard to anticipate weekly, monthly and especially yearly profits, and it can be hard to anticipate when the payments will actually come in. This can be nerve-wracking for many people, so it must be remembered that those who do not enjoy risks may not enjoy freelance work.</p>
<p>There are many advantages and disadvantages to freelance work, just as there are to any other type of job. If you want to learn more about what it is really like to be a freelance worker, contact an individual in your area and see if you can pick their brains or even shadow them for a day. Learning from someone in the trenches is often the best way to decide if freelancing is for you.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelance-php-developer.phpmysql.co.za/2010/07/working-as-a-freelancer/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>PHP Developer CodeIgniter MVC Framework</title>
		<link>http://freelance-php-developer.phpmysql.co.za/2010/06/php-developer-codeigniter-mvc-framework/</link>
		<comments>http://freelance-php-developer.phpmysql.co.za/2010/06/php-developer-codeigniter-mvc-framework/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 06:03:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freelance Web Developer]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Freelance PHP Developer]]></category>
		<category><![CDATA[PHP Developer]]></category>
		<category><![CDATA[php freelancer]]></category>
		<category><![CDATA[Senior PHP Developer]]></category>

		<guid isPermaLink="false">http://freelance-php-developer.phpmysql.co.za/?p=81</guid>
		<description><![CDATA[Everything You Need to Get Started With CodeIgniter


Tutorial Details

Difficulty: Beginner
Technology:  PHP



CodeIgniter is a web application framework for PHP. It enables  developers to build web applications faster, and it offers many helpful  code libraries and helpers which speed up tedious tasks in PHP.  CodeIgniter is based on a modular design; meaning that [...]


No related posts.

Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>Everything You Need to Get Started With CodeIgniter</h1>
<div><!-- [END] Social Media --></p>
<div>
<h5>Tutorial Details</h5>
<ul>
<li><strong>Difficulty</strong>: Beginner</li>
<li><strong>Technology</strong>:  PHP</li>
</ul>
</div>
</div>
<p>CodeIgniter is a web application framework for PHP. It enables  developers to build web applications faster, and it offers many helpful  code libraries and helpers which speed up tedious tasks in PHP.  CodeIgniter is based on a modular design; meaning that you can implement  specific libraries at your discretion – which adds to the speed of the  framework. This tutorial will attempt to show you the basics of setting  up the framework, including how to build a basic hello world application  that uses the MVC approach.</p>
<hr />
<h2>Why a Framework?</h2>
<div><img src="http://nettuts.s3.amazonaws.com/180_efficientcode/frameworks.png" alt="Why a Framework?" /></div>
<p>Frameworks allow for structure in developing applications by  providing reusable classes and functions which can reduce development  time significantly. Some downsides to frameworks are that they provide  unwanted classes, adding code bloat which makes the app harder to  navigate.</p>
<hr />
<h2>Why CodeIgniter?</h2>
<div><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/20090118-180850.png" alt="CodeIgniter Basics" /></div>
<p>CodeIgniter is a very light, well performing framework. While, it is  perfect for a beginner (because<br />
 of the small learning curve), it’s also perfect for large and  demanding web applications. CodeIgniter is developed by EllisLab and has  thorough, easy to understand<br />
 documentation. Below is a list of reasons of what makes CodeIgniter a  smart framework to use?</p>
<ul>
<li> Small footprint with exceptional performance</li>
<li> MVC approach to development (although it is very loosely based  which allows for flexibility)</li>
<li> Generates search engine friendly clean URLs</li>
<li> Easily extensible</li>
<li> Runs on both PHP 4 (4.3.2+) and 5</li>
<li> Support for most major databases including MySQL (4.1+), MySQLi, MS  SQL, Postgres, Oracle, SQLite,<br />
 and ODBC.</li>
<li> Application security is a focus</li>
<li> Easy caching operations</li>
<li> Many libraries and helpers to help you with complex operations such  as email, image manipulation,<br />
 form validation, file uploading, sessions, multilingual apps and  creating apis for your app</li>
<li> Most libraries are only loaded when needed which cuts back on  resources needed</li>
</ul>
<hr />
<h2>Why MVC?</h2>
<div><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/mvc.png" alt="MVC" /></div>
<p>For starters, MVC stands for Model, View, Controller. It is a  programing pattern used in developing<br />
 web apps. This pattern isolates the user interface and backend (i.e.  database interaction from each other. A successful<br />
 implementation of this lets developers modify their user interface or  backend with out affecting<br />
 the other. MVC also increases the flexibly of an app by being able to  resuse models or views over<br />
 again). Below is a description of MVC.</p>
<ul>
<li> <strong>Model:</strong> The model deals with the raw data and  database interaction and will contain functions<br />
 like adding records to a database or selecting specific database  records. In CI the model<br />
 component is not required and can be included in the controller.</li>
<li> <strong>View:</strong> The view deals with displaying the data and  interface controls to the user with.<br />
 In CI the view could be a web page, rss feed, ajax data or any other  “page”.</li>
<li> <strong>Controller:</strong> The controller acts as the in between  of view and model and, as the name suggests,<br />
 it controls what is sent to the view from the model. In CI, the  controller is also the place to load libraries and helpers.</li>
</ul>
<p>An example of a MVC approach would be for a contact form.</p>
<ol>
<li> The user interacts with the view by filling in a form and  submitting it.</li>
<li> The controller receives the POST data from the form, the controller  sends this data to the model<br />
 which updates in the database.</li>
<li> The model then sends the result of the database to the controller.</li>
<li> This result is updated in the view and displayed to the user.</li>
</ol>
<p>This may sound like alot of work to do. But, trust me; when you’re  working with a large application, being able to reuse models or views  saves a great deal of time.</p>
<hr />
<h2>Step 1: Downloading CodeIgniter</h2>
<p>Too start off you will need to download CodeIgniter and upload it to  your server. Point your browser<br />
 to <a title="http://www.codeigniter.com/" href="http://www.codeigniter.com/">http://www.codeigniter.com/</a> and<br />
 click the large download button. For this tutorial we are using  version 1.70.</p>
<div><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/img/download.jpg" border="0" alt="" width="260" height="60" /></div>
<hr />
<h2>Step 2: Installing and Exploring CodeIgniter</h2>
<p>Once you have downloaded CodeIgniter, all you need to do is unzip it,  and rename the “CodeIgniter_1.7.0″ folder to<br />
 either the application name or, in this case, “ci” and upload it to  your PHP and MySQL enabled server.<br />
 Now that its on your server, I’ll explain what all the folders and  files are for:</p>
<div><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/img/folders.jpg" alt="" width="175" height="374" /></div>
<ul>
<li> The <strong>system</strong> folder stores all the files which make  CI work.
<ul>
<li> The <strong>application</strong> folder is almost identical to the  contents of the <strong>system</strong> folder<br />
 this is so the user can have files that are particular to that  application, for example if a<br />
 user only wanted to load a helper in one application he would  place it in the <strong>system/application/helpers</strong> folder<br />
 instead of the <strong>system/helpers</strong> folder.</p>
<ul>
<li> The <strong>config </strong>folder stores all the config files  relevant to the application. Which<br />
 includes information on what libaries the application should  auto load and database details.</li>
<li> The <strong>controllers </strong>folder stores all the controllers  for the application.</li>
<li> The <strong>errors </strong>folder stores all the template error  pages for the application. When<br />
 an error occurs the error page is generated from one of  these templates.</li>
<li> The <strong>helpers </strong>folder stores all the helpers which  are specific to your application.</li>
<li> The <strong>hooks </strong>folder is for hooks which modify the  functioning of CI’s core files,<br />
 hooks should only be used by advanced users of CI</li>
<li> The <strong>language </strong>folder stores lines of text which can  be loaded through the language<br />
 library to create multilingual sites.</li>
<li> The <strong>libraries </strong>folder stores all the libraries  which are specific to your application.</li>
<li> The <strong>models </strong>folder stores all the models for the  application.</li>
<li> The <strong>views </strong>folder stores all the views for the  application.</li>
</ul>
</li>
<li> The <strong>cache</strong> folder stores all the caches generated  by the caching library.</li>
<li> The <strong>codeigniter</strong> folder stores all the internals  which make CI work.</li>
<li> The <strong>database </strong> folder stores all the database  drivers and class which enable you to<br />
 connect to database.</li>
<li> The <strong>fonts</strong> folder stores all the fonts which can be  used by the image manipulation library.</li>
<li> The <strong>helpers</strong> folder stores all of CI’s core helpers  but you can place your own helpers<br />
 in here which can be accessed by all of your applications.</li>
<li> The <strong>language </strong>folder stores all of CI’s core  language files which its libaries and helpers<br />
 use. You can also put your own language folders which can  accessed by all of your applications.</li>
<li> The <strong>libaries </strong>folder stores all of CI’s core  libaries but you can place your own libraries<br />
 in here which can be accessed by all of your applications</li>
<li> The <strong>logs</strong> folder stores all of the logs generated  by CI.</li>
<li> The <strong>plugin </strong>folder stores all of the plugins which  you can use. Plugins are almost identical<br />
 to helpers, plugins are functions intended to be shared by the  community.</li>
<li> The <strong>scaffolding </strong>folder stores all the files which  make the scaffolding class work.<br />
 Scaffolding provides a convenient CRUD like interface to access  information in your database<br />
 during development.</li>
</ul>
</li>
<li> The <strong>user_guide</strong> houses the user guide to CI.</li>
<li> The <strong>index.php</strong> file is the bit that does all the CI  magic it also lets the you change the<br />
 name of the <strong>system </strong>and <strong>application </strong>folders.</li>
</ul>
<hr />
<h2>Step 3: Configuring CodeIgniter</h2>
<p>Getting CI up and running is rather simple. Most of it requires you  to edit a few configuration<br />
 files.</p>
<p>You need to setup CI to point to the right base URL of the app. To do  this, open up <strong>system/application/config/config.php</strong> and<br />
 edit the base_url array item to point to your  server and CI folder.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>$config['base_url'] = &#8220;http://localhost/ci/&#8221;;</li>
</ol>
</div>
<pre>$config['base_url'] = "http://localhost/ci/";</pre>
<hr />
<h2>Step 4: Testing CodeIgniter</h2>
<p>We’ll do a quick test to see if CI is up and running properly. Go to http://localhost/ci/ and you<br />
 should see the following.</p>
<p><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/img/test.jpg" alt="" width="550" height="443" /></p>
<hr />
<h2>Step 5: Configuring CodeIgniter Cont.</h2>
<p>If you’re up and running, we should finish the configuration. We are  starting to configure it specifically for our new helloworld app. If you  want to use a database with your application, (which in this tutorial  we do.) open up <strong>system/application/config/database.php</strong> and set the following array items to there corresponding values. This  code connects to a MySQL<br />
 database called “helloworld” on a localhost  with the username “root”, and the password, “root”.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>$db['default']['hostname'] = &#8220;localhost&#8221;;</li>
<li>$db['default']['username'] = &#8220;root&#8221;;</li>
<li>$db['default']['password'] = &#8220;root&#8221;;</li>
<li>$db['default']['database'] = &#8220;helloworld&#8221;;</li>
<li>$db['default']['dbdriver'] = &#8220;mysql&#8221;;</li>
</ol>
</div>
<pre>$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "root";
$db['default']['database'] = "helloworld";
$db['default']['dbdriver'] = "mysql";</pre>
<p>Additionally, since we will be using the database quite a bit, we  want it to auto load so that we don’t<br />
 have to specifically load it each time we connect. Open the <strong>sys</strong><strong>tem/application/config/autoload.php </strong>file<br />
 and add ‘database’ to the autoload libaries array.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>$autoload['libraries'] = array(&#8216;database&#8217;);</li>
</ol>
</div>
<pre>$autoload['libraries'] = array('database');</pre>
<p>Currently, the CI setup will have a default controller called  “welcome.php”; you can find this in the <strong>system/application/controllers</strong> folder. For this tutorial, delete it and open your <strong>system/application/config/routes.php</strong> file. Change the default array item to point to the “helloworld”  controller.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>$route['default_controller'] = &#8220;Helloworld&#8221;</li>
</ol>
</div>
<pre> $route['default_controller'] = "Helloworld"</pre>
<p>CI also has a view file that we do not need. Open up the <strong>system/application/view/</strong> folder<br />
 and delete the <strong>welcome_message.php</strong> file.</p>
<hr />
<h2>Step 6: Create the Helloworld Database</h2>
<p>As this isn’t really a tutorial on MySQL, I’ll keep this section as  short as possible. Create a database called “helloworld” and<br />
 run the following SQL through phpMyAdmin (or similar MySQL client).</p>
<div>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>CREATE TABLE `data` (</li>
<li> `id` int(11) NOT NULL auto_increment,</li>
<li> `title` varchar(255) NOT NULL,</li>
<li> `text` text NOT NULL,</li>
<li> PRIMARY KEY  (`id`)</li>
<li>) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;</li>
<li></li>
<li>INSERT INTO `data` (`id`, `title`, `text`) VALUES(1, &#8216;Hello World!&#8217;, &#8216;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla</li>
<li>sapien eros, lacinia eu, consectetur vel, dignissim et, massa. Praesent suscipit nunc vitae neque. Duis a ipsum. Nunc a erat. Praesent</li>
<li>nec libero. Phasellus lobortis, velit sed pharetra imperdiet, justo ipsum facilisis arcu, in eleifend elit nulla sit amet tellus.</li>
<li>Pellentesque molestie dui lacinia nulla. Sed vitae arcu at nisl sodales ultricies. Etiam mi ligula, consequat eget, elementum sed,</li>
<li>vulputate in, augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;&#8217;);</li>
</ol>
</div>
<pre>CREATE TABLE `data` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

INSERT INTO `data` (`id`, `title`, `text`) VALUES(1, 'Hello World!', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
sapien eros, lacinia eu, consectetur vel, dignissim et, massa. Praesent suscipit nunc vitae neque. Duis a ipsum. Nunc a erat. Praesent
nec libero. Phasellus lobortis, velit sed pharetra imperdiet, justo ipsum facilisis arcu, in eleifend elit nulla sit amet tellus.
Pellentesque molestie dui lacinia nulla. Sed vitae arcu at nisl sodales ultricies. Etiam mi ligula, consequat eget, elementum sed,
vulputate in, augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;');</pre>
<hr />
<h2>Step 7: Create the Helloworld Model</h2>
<p>Models are optional in CI, but it’s considered best practice to use  them. They are just PHP classes that contain<br />
functions which work with information from the database. Go<br />
ahead and make a <strong>helloworld_model.php</strong> file<br />
in the <strong>system/application/models</strong> folder.<br />
In this file, create a Helloworld_model class, Helloworld_model  construct and a function called getData.</p>
<p>In the getData  function we are<br />
going to use Active Record database functions which speed up database  development times when working<br />
with CI and databases. Essentially, they are simplified functions to  create queries.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>&lt;?php</li>
<li>class Helloworld_model extends Model {</li>
<li></li>
<li> function Helloworld_model()</li>
<li> {</li>
<li> // Call the Model constructor</li>
<li> parent::Model();</li>
<li> }</li>
<li></li>
<li> function getData()</li>
<li> {</li>
<li> //Query the data table for every record and row</li>
<li> $query = $this-&gt;db-&gt;get(&#8216;data&#8217;);</li>
<li></li>
<li> if ($query-&gt;num_rows() &gt; 0)</li>
<li> {</li>
<li> //show_error(&#8216;Database is empty!&#8217;);</li>
<li> }else{</li>
<li> return $query-&gt;result();</li>
<li> }</li>
<li> }</li>
<li></li>
<li>}</li>
<li>?&gt;</li>
</ol>
</div>
<pre>&lt;?php
class Helloworld_model extends Model {

    function Helloworld_model()
    {
        // Call the Model constructor
        parent::Model();
    }

    function getData()
		{
			//Query the data table for every record and row
			$query = $this-&gt;db-&gt;get('data');

			if ($query-&gt;num_rows() &gt; 0)
			{
				//show_error('Database is empty!');
			}else{
				return $query-&gt;result();
			}
		}

}
?&gt;</pre>
<hr />
<h2>Step 8: Create the Helloworld Controller</h2>
<p>Let’s create a controller that will display the view, and load the  model. That way, when<br />
you go to the address http://localhost/ci/index.php/helloworld/, you  will see the data from the database.<br />
In the folder <strong>system/application/controllers</strong>, create a  file called <strong>helloworld.php</strong>.<br />
In this new file, we’ll create a class which has the same name as the  file.</p>
<p>Within this class, you need to create a function called “index”. This  is the function that will be<br />
displayed when no other is provided – e.g. when  http://localhost/ci/index.php/helloworld/ is<br />
visited. If, for example, we created a function called foo, we could  find this as http://localhost/ci/index.php/helloworld/foo/.</p>
<p>The key thing to remember is how CI structures its URLs; e.g  http://host/codeignitordirectory/index.php/class/function.</p>
<p>In the controller index function, we need to load the model, query  the database, and pass this queried<br />
data to the view. To load any resources into CI e.g. libraries,<br />
helpers, views, or, models, we use the load class. After we have  loaded the model, we can access it through<br />
its model name and the particular function. To pass data to a view we  need to assign it to an array<br />
item and pass the array – which recreates the array items as a  variable in the view file.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>&lt;?php</li>
<li> class Helloworld extends Controller{</li>
<li> function index()</li>
<li> {</li>
<li> $this-&gt;load-&gt;model(&#8216;helloworld_model&#8217;);</li>
<li></li>
<li> $data['result'] = $this-&gt;helloworld_model-&gt;&lt;span class=&#8221;sql&#8221;&gt;getData&lt;/span&gt;();</li>
<li> $data['page_title'] = &#8220;CI Hello World App!&#8221;;</li>
<li></li>
<li> $this-&gt;load-&gt;view(&#8216;helloworld_view&#8217;,$data);</li>
<li> }</li>
<li> }</li>
<li>?&gt;</li>
</ol>
</div>
<pre>&lt;?php
	class Helloworld extends Controller{
		function index()
		{
			$this-&gt;load-&gt;model('helloworld_model');

			$data['result'] = $this-&gt;helloworld_model-&gt;getData();
			$data['page_title'] = "CI Hello World App!";

			$this-&gt;load-&gt;view('helloworld_view',$data);
	    }
	}
?&gt;</pre>
<p>If we visited  http://localhost/ci/index.php/helloworld/ now, it  wouldn’t work; this is because the view file does not exist.</p>
<div><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/img/error.jpg" alt="" width="550" height="443" /></div>
<hr />
<h2>Step 9: Create the Helloworld View</h2>
<p>The view file is what the user sees and interacts with, it could be a  segment of a page, or the whole page. You can pass an array of  variables to the view through the second argument<br />
of the load model function. To make the view for our tutorial, create a  new file called <strong>helloworld</strong><strong>_view.php</strong> in the <strong>system/application/view</strong> folder. Next, we just  need to create our normal html, head<br />
and body elements, and then a header and paragraph for the information  from the database. To display all<br />
the records received from the database, we put it in a “foreach” loop<br />
which loops through all the elements.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>&lt;html&gt;</li>
<li> &lt;head&gt;</li>
<li> &lt;title&gt;&lt;?=$page_title?&gt;&lt;/title&gt;</li>
<li> &lt;/head&gt;</li>
<li> &lt;body&gt;</li>
<li> &lt;?php foreach($result as $row):?&gt;</li>
<li> &lt;h3&gt;&lt;?=$row-&gt;title?&gt;&lt;/h3&gt;</li>
<li> &lt;p&gt;&lt;?=$row-&gt;text?&gt;&lt;/p&gt;</li>
<li> &lt;br /&gt;</li>
<li> &lt;?php endforeach;?&gt;</li>
<li> &lt;/body&gt;</li>
<li>&lt;/html&gt;</li>
</ol>
</div>
<pre>&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;&lt;?=$page_title?&gt;&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;?php foreach($result as $row):?&gt;
		&lt;h3&gt;&lt;?=$row-&gt;title?&gt;&lt;/h3&gt;
		&lt;p&gt;&lt;?=$row-&gt;text?&gt;&lt;/p&gt;
		&lt;br /&gt;
		&lt;?php endforeach;?&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre>
<p>You may have noticed that we are using php alternative syntax, this  provides an convenient and time<br />
saving way to write echo statements.</p>
<hr />
<h2>Step 10: Ta-da and Some Extras</h2>
<p>When you visit “http://localhost/ci/index.php/helloworld/”, you<br />
should see something similar to this.</p>
<div><img src="http://nettuts.s3.amazonaws.com/183_codeIgniter/img/ta-da.jpg" alt="" width="550" height="443" /></div>
<p>But we aren’t done yet. There are a few things you can do to improve  your CodeIgniter experience -<br />
like removing  that annoying  index.php bit out of the URL. You  can accomplish this task by creating a .htaccess file in the root  folder, and adding the following code.</p>
<pre>RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ ci/index.php/$1 [L]
</pre>
<p>You’ll also need to open up the <strong>config.php</strong> file in <strong>system/application/config/</strong> and edit the index_page array item to a blank string.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>$config['index_page'] = &#8220;&#8221;;</li>
</ol>
</div>
<pre>$config['index_page'] = "";</pre>
<p>Another nifty trick is to turn on CI’s ability to parse PHP  alternative syntax if its<br />
not enabled by the server. To do this, open up the same  file as before, <strong>system/application/config/config.php</strong>,  and set the rewrite_short_tags array item to TRUE.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="#"></a></div>
</div>
<ol>
<li>$config['rewrite_short_tags'] = TRUE;</li>
</ol>
</div>
<pre>$config['rewrite_short_tags'] = TRUE;</pre>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelance-php-developer.phpmysql.co.za/2010/06/php-developer-codeigniter-mvc-framework/feed/</wfw:commentRss>
		<slash:comments>323</slash:comments>
		</item>
		<item>
		<title>PHP freelancer Retrieving Data in a Range by SQL BETWEEN</title>
		<link>http://freelance-php-developer.phpmysql.co.za/2010/03/php-freelancer-retrieving-data-in-a-range-by-sql-between/</link>
		<comments>http://freelance-php-developer.phpmysql.co.za/2010/03/php-freelancer-retrieving-data-in-a-range-by-sql-between/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 10:12:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freelance Web Developer]]></category>
		<category><![CDATA[MySQL Tutorials]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php freelancer]]></category>

		<guid isPermaLink="false">http://freelance-php-developer.phpmysql.co.za/?p=70</guid>
		<description><![CDATA[
Working with Database
Create a database with a specified name if it does not exist  in database server
CREATE DATABASE [IF NOT EXISTS] database_name
Use database or change current database to another database  you are working with
USE database_name
Drop a database with specified name permanently. All  physical file associated with the database is no longer exists.
DROP [...]


No related posts.

Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.]]></description>
			<content:encoded><![CDATA[<div>
<h2>Working with Database</h2>
<p>Create a database with a specified name if it does not exist  in database server</p>
<pre>CREATE DATABASE [IF NOT EXISTS] database_name</pre>
<p>Use database or change current database to another database  you are working with</p>
<pre>USE database_name</pre>
<p>Drop a database with specified name permanently. All  physical file associated with the database is no longer exists.</p>
<pre>DROP DATABASE [IF EXISTS] database_name</pre>
<p>Show all available databases in database server</p>
<pre>SHOW DATABASES</pre>
<h2>Working with Table</h2>
<p>Lists all tables in a database.</p>
<pre>SHOW TABLES</pre>
<p>Create table statement defines the structure of table in a  database.</p>
<pre> CREATE [TEMPORARY] TABLE [IF NOT EXISTS] <em>table_name</em>
 (<em>create_clause ,</em>...) [<em>table_options</em>]
 [[IGNORE|REPLACE] <em>select</em>]</pre>
<p>Altering table structure</p>
<pre>ALTER [IGNORE] TABLE <em>table_name</em> <em>actions</em></pre>
<p>Actions can be one of the following actions:</p>
<pre>ADD [COLUMN]</pre>
<p>Add a new column into a table</p>
<pre>DROP [COLUMN]</pre>
<p>Drop an existing column in a table</p>
<pre>ADD INDEX [name](column_name, ...)</pre>
<p>Add index with a specific name to a table on a column</p>
<pre>DROP INDEX index_name Drop an index from a table</pre>
<p>ADD PRIMARY KEY (column_name,&#8230;)</p>
<p>Add primary key into a tables</p>
<pre>DROP PRIMARY KEY</pre>
<p>Drop primary key from a table</p>
<p>Deleting table permanently</p>
<pre> DROP TABLE [IF EXISTS] <em>table_name</em> [, <em>name2</em>, ...]
 [RESTRICT | CASCADE]
</pre>
<p>Give information about the table or column.</p>
<pre>DESCRIBE table [column_name]
DESC table [column_name]<strong><em>
 </em></strong></pre>
<h2>Working with Index</h2>
<p>Creating an index with the specified name on a table</p>
<pre>CREATE [UNIQUE|FULLTEXT] INDEX index_name
ON table (column_name,...)</pre>
<p>Removing a specified index from table</p>
<pre>DROP INDEX index_name</pre>
<h2>Retrieving Data</h2>
<p>Retrieving complete data in a database table</p>
<pre>SELECT * FROM table_name</pre>
<p>Retrieving specified data which is shown in the column list  from a database table</p>
<pre>SELECT column_name, column_name2….
FROM table_name</pre>
<p>Retrieving unique records</p>
<pre>SELECT DISTINCT (column_name)
FROM table_name</pre>
<p>Retrieving data from multiples table using join</p>
<pre>SELECT *
FROM table_name1
INNER JOIN table_name2 ON conditions</pre>
<pre>SELECT *
FROM table_name1
LEFT JOIN table_name2 ON conditions</pre>
<p>SELECT *<br />
FROM table_name1<br />
RIGHT JOIN table_name2 ON conditions</p>
<p>Counting number of rows in a database table</p>
<pre>SELECT COUNT (*)
FROM table_name</pre>
<p>Sorting ascending or descending retrieved data based on one  or more column</p>
<pre>SELECT column_name, column_name2….
FROM table_name
ORDER BY column_name ASC [DESC], column_name2 ASC [DESC],</pre>
<p>Group the retrieved rows data</p>
<pre>SELECT *
FROM table_name
GROUP BY column_name</pre>
<h2>Matching Data based on a pattern</h2>
<p>Matching data using LIKE operator</p>
<pre>SELECT * FROM table_name
WHERE column_name LIKE ‘%value%’</pre>
<h2>Matching data using regular expression</h2>
<pre>SELECT * FROM table_name
WHERE column_name RLIKE ‘regular_expression’
<div>
<div>
<div id="contentarea">
 

 

<strong>Mark
 BSc Honours in Computer Science
 Software Architect / Developer
 Mobile 079 9111 855</strong>

<strong>Email <a href="mailto:info@mydeveloper.co.za"><strong>info@mydeveloper.co.za</strong></a></strong>
</div>
</div>
</div>
</pre>
</div>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelance-php-developer.phpmysql.co.za/2010/03/php-freelancer-retrieving-data-in-a-range-by-sql-between/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Querying data by using SQL UNION</title>
		<link>http://freelance-php-developer.phpmysql.co.za/2010/03/querying-data-by-using-sql-union/</link>
		<comments>http://freelance-php-developer.phpmysql.co.za/2010/03/querying-data-by-using-sql-union/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 10:05:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freelance Web Developer]]></category>
		<category><![CDATA[MySQL Tutorials]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Freelance PHP]]></category>
		<category><![CDATA[PHP Developer]]></category>
		<category><![CDATA[php freelancer]]></category>
		<category><![CDATA[Senior PHP Developer]]></category>

		<guid isPermaLink="false">http://freelance-php-developer.phpmysql.co.za/?p=68</guid>
		<description><![CDATA[
SQL UNION allows you to combine two or more result sets from select statements into a single result set. The usage of using SQL UNION is as follows:
SELECT statement
UNION [DISTINCT &#124; ALL]
SELECT statement
UNION [DISTINCT &#124; ALL]
…
The column list of each individual SELECT statement must have the same data type. By default the UNION removes all [...]


No related posts.

Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.]]></description>
			<content:encoded><![CDATA[<div>
<p>SQL UNION allows you to combine two or more result sets from select statements into a single result set. The usage of using SQL UNION is as follows:</p>
<pre>SELECT statement
UNION [DISTINCT | ALL]
SELECT statement
UNION [DISTINCT | ALL]</pre>
<p>…<br />
The column list of each individual SELECT statement must have the same data type. By default the UNION removes all duplicated rows from the result set even if you don’t explicit using DISTINCT after the UNION keyword. If you use UNION ALL explicitly, the duplicated rows will remain in the result set. Let’s practice with couples of examples which use SQL UNION. Suppose you want to combine customers and employees into one, you just perform the following query:</p>
<pre>SELECT customerNumber id, contactLastname name
FROM customers
UNION
SELECT employeeNumber id,firstname name
FROM employees</pre>
<p>Here is the excerpt of the output</p>
<pre>    id  name
------  ---------------
   103  Schmitt
   112  King
   114  Ferguson
   119  Labrune
   121  Bergulfsen
   124  Nelson
   125  Piestrzeniewicz
   128  Keitel
   129  Murphy
   131  Lee
</pre>
<p>In order to use ORDER BY to sort the result you have to use it after the last SELECT statement. It would be the best to parenthesize all the SELECT statements and place ORDER BY after the last one. Suppose we use the want to sort the combination of employees and customers in the query above we can do as follows:</p>
<pre>(SELECT customerNumber id,contactLastname name
FROM customers)
UNION
(SELECT employeeNumber id,firstname name
FROM employees)
ORDER BY name,id</pre>
<p>First it orders the result set by name and then by id  What if we don’t use alias for each column in the SELECT statement? MySQL uses the column names in the first SELECT statement as the label of the result therefore you can rewrite the query above as follows:</p>
<pre>(SELECT customerNumber, contactLastname
FROM customers)
UNION
(SELECT employeeNumber, firstname
FROM employees)
ORDER BY contactLastname, customerNumber</pre>
<p>or you can also use the column position in the ORDER BY clause like following query</p>
<pre>(SELECT customerNumber, contactLastname
FROM customers)
UNION
(SELECT employeeNumber,firstname
FROM employees)
ORDER BY 2, 1</pre>
</div>
<div>
<div>sql union,mysql union,sql union all,sql union distinct,sql union order by,sql union sort,mysql union order by</div>
</div>
<div></div>
<div>
<h3><a title="Website Maintenance and Support" href="http://phpmysql.co.za/00index.php#" target="_blank">Contact Details </a></h3>
<p>Mark<br />
BSc Honours in Computer Science<br />
PHP Developer<br />
Mobile 079 9111 855</p>
<p>Email <a href="mailto:info@mydeveloper.co.za"><strong>info@mydeveloper.co.za </strong></a></p>
</div>
<div><script type="text/javascript">// <![CDATA[
google_ad_client = "pub-0824680748064651";
/* 300x250, created 08/11/08 */
google_ad_slot = "1604354168";
google_ad_width = 300;
google_ad_height = 250;
// ]]&gt;</script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script><script type="text/javascript">// <![CDATA[
google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);
// ]]&gt;</script><ins><ins></ins></ins></div>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelance-php-developer.phpmysql.co.za/2010/03/querying-data-by-using-sql-union/feed/</wfw:commentRss>
		<slash:comments>59</slash:comments>
		</item>
		<item>
		<title>PHP</title>
		<link>http://freelance-php-developer.phpmysql.co.za/2010/03/php-freelancer/</link>
		<comments>http://freelance-php-developer.phpmysql.co.za/2010/03/php-freelancer/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 20:49:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freelance Web Developer]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[freelance developer]]></category>
		<category><![CDATA[freelance programmer]]></category>
		<category><![CDATA[freelance web developer]]></category>
		<category><![CDATA[php freelancer]]></category>

		<guid isPermaLink="false">http://freelance-php-developer.phpmysql.co.za/?p=45</guid>
		<description><![CDATA[PHP (&#8220;Hypertext Preprocessor&#8221;) is a widely-used Open Source general-purpose scripting language that is especially suited for Web applications and website development, and can be embedded into HTML. Most of its syntax draws upon C, Java, and Perl, being very easy to learn. The main goal of the PHP language is to allow web developers to [...]


No related posts.

Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>PHP (&#8220;Hypertext Preprocessor&#8221;) is a widely-used Open Source general-purpose scripting language that is especially suited for Web applications and website development, and can be embedded into HTML. Most of its syntax draws upon C, Java, and Perl, being very easy to learn. The main goal of the PHP language is to allow web developers to write dynamically generated web pages quickly, but due to its powerful flexibility, you can do much more with it.</p>
<p>What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server. If you were to have a script similar to the above on your server, the client would receive the results of running that script, with no way of determining what the underlying code may be. You can even configure your web server to process all your HTML files with PHP, and then there&#8217;s really no way that users can tell what you have up your sleeve.</p>
<p>The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer.</p>
<p>If you require  professional Freelance PHP coding , please do not hesitate to contact me on <strong>079 9111 855 or email info@mydeveloper.co.za</strong></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://www.wordpressconnect.net/amazonpress/'>Amazon plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelance-php-developer.phpmysql.co.za/2010/03/php-freelancer/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
	</channel>
</rss>

