<?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>Mahbubur Rahman - jQuery, PHP, JavaScript, Codeigniter, CSS &#187; Php</title>
	<atom:link href="http://www.mahbubblog.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mahbubblog.com</link>
	<description>PHP, JQUERY, JAVASCRIPT fun</description>
	<lastBuildDate>Thu, 03 Jun 2010 07:23:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Interview for PHP programmer</title>
		<link>http://www.mahbubblog.com/php/interview-for-php-programmer/</link>
		<comments>http://www.mahbubblog.com/php/interview-for-php-programmer/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 13:01:03 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[php programmers]]></category>
		<category><![CDATA[recruitment]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=213</guid>
		<description><![CDATA[So, in Blueliner Bangladesh, we needed some PHP programmers in the coming months. I almost took over 20  interviews from screened out CVs and found some good candidates. There&#8217;s some points we&#8217;d like the programmers of this country to be concerned about. Here are some of my observations and recommendations. You have to learn yourself. [...]]]></description>
			<content:encoded><![CDATA[<p>So, in Blueliner Bangladesh, we needed some PHP programmers in the coming months. I almost took over 20  interviews from screened out CVs and found some good candidates. There&#8217;s some points we&#8217;d like the programmers of this country to be concerned about. Here are some of my observations and recommendations.</p>
<p><strong>You have to learn yourself. Company may not give the opportunity!</strong></p>
<p>This is one of the most common pitfalls i found in this recruitment drive. Most people complain that they don&#8217;t get enough time to learn about the latest tools and technologies. But the thing is, It&#8217;s your career! the companies will always try to get the best out of you within shortest possible budget and time. And at the same time you have to enrich yourself not only through the projects you get but also with some voluntary open source projects. What most companies don&#8217;t realize that, if the programmers are not given some room to do R&amp;D, it&#8217;s eventually the organization who will lose by compromising with the standards of the programmer against budget. And the programmers are not updates with the latest tools technologies. So, guys! you have to take some personal effort to play with the newer things. Even if you don&#8217;t get a minute in the workplace, find some time at home to do some R&amp;D. It will pay off inshAllah.</p>
<p><strong>Ability to do things VS Ability to do things with Art</strong>.</p>
<p>There are hell lot of renowned Javascript programmers but how many do we know? John Resig, Jack Slocum, Remy Sharp and so on. Why do we know them ? Because they did something which others didn&#8217;t. They did things with Art for which we know them. So all the promising programmers, please concentrate on doing thing with Art. If you know jQuery, learn how it works, who&#8217;re the people behind it, follow them on twitter, read their blogs. Let alone <a href="http://ejohn.org/">John Resig&#8217;s Blog</a> can give you a very good insight what&#8217;s being cooked for the next generation javascripts. BE detail oriented about things you play everyday with. You&#8217;ll always be appreciated for things you want to do not &#8220;things you had to do&#8221;.</p>
<p><strong>Object Oriented Programming</strong></p>
<p>PHP had been very lose in standards and conventions when it comes to Object Oriented Programming. The recent releases of PHP are much more matured that it used to be in the past. I started in 2000. We can do lot of things without even following the standard way. But dear PHP programmers, better companies or promising companies will take you because you&#8217;ll make some magical changes, add some new dimensions in the organization. So please be very clear and efficient about Object Oriented Concepts and way of doing those things in PHP. There&#8217;s a difference between a programmer who declares a class &#8220;abstract&#8221; knowing when it&#8217;s needed and a programmer who knows OOP but doesn&#8217;t want to declare the class abstract. PHP is not at the pick of it&#8217;s maturity. So try to discover which things are absent in OO PHP which are there in other languages (C++,Java, Ruby).</p>
<p><strong>Have some publishing activities</strong></p>
<p>To present yourself as a passionate programmer, you gotta have a blog or some sort of publishing which is visible on the WWW. If you have a blog and you write about things you play with, problems, time saving solutions, it will help you a lot getting the attention as a good, focused and passionate programmers. So start your blog now if you don&#8217;t have one. It takes a little time to get used to with some writing habit.</p>
<p><strong>Care more on the CV</strong></p>
<p>May people simply flooded of with bunch of tools and technologies. Many of cv looked like they are Jack of All trades. But hardly anyone was proficient in all they mentioned. So please, do not put items on which you don&#8217;t have substantial hold of and just for the sake of filling up CV. If you write you are good at Javascript, expect advanced level questions from JS. If you write &#8220;Good in OOP&#8221; , expect higher level questions from OOP.  Make the CV withing 3 pages maximum. It irritates the interviewer when people have long descriptions about each project you have worked on.</p>
<p>There are other points i wanted to write but the post will become longer than the comfortable or acceptable length. So i&#8217;ll share some more next hopefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/interview-for-php-programmer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sorting table columns in mysql by adminer</title>
		<link>http://www.mahbubblog.com/php/sorting-table-columns-in-mysql-by-adminer/</link>
		<comments>http://www.mahbubblog.com/php/sorting-table-columns-in-mysql-by-adminer/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 05:16:13 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=207</guid>
		<description><![CDATA[Sorting columns in a mysql table has always been a nasty way to deal with. It can be done some sql commands of course but this is not what we do more often. Even the most popular DB admin package &#8211; phpmyadmin doesn&#8217;t provide such utility to sort or re-arrange fields in mysql. It occurred [...]]]></description>
			<content:encoded><![CDATA[<p>Sorting columns in a mysql table has always been a nasty way to deal with. It can be done some sql commands of course but this is not what we do more often. Even the most popular DB admin package &#8211; phpmyadmin doesn&#8217;t provide such utility to sort or re-arrange fields in mysql. It occurred to me a lot of times that i had to bring some filed to a different position for convenience after i first created it. But i had to run some queries which i never liked, to do this task.</p>
<p>So ADMINER (formerly phpminadmin) comes up with a nifty utility in their one file standalone package.</p>
<p>If you haven&#8217;t heard of Adminer yet (you must have missed a great tool),  download from http://www.adminer.org/en/</p>
<p>And run it from your web server from any location. After entering credentials and selecting database, just select a table from the left which appears like this.</p>
<p><a href="http://www.mahbubblog.com/wp-content/uploads/2009/09/adminer_table_select.jpg"><img class="alignnone size-medium wp-image-208" title="adminer_table_select" src="http://www.mahbubblog.com/wp-content/uploads/2009/09/adminer_table_select-300x157.jpg" alt="adminer_table_select" width="300" height="157" /></a></p>
<p>Now you get some options like &#8211; Alter table   |   Default values  |   Select table  |  New item</p>
<p>Select Alter Table and you get a screen like this</p>
<p><a style="text-decoration: none; color: #cc6600; padding: 0px; margin: 0px; border: 0px initial initial;" href="http://www.mahbubblog.com/wp-content/uploads/2009/09/adminer.jpg"><img style="text-align: center; padding: 0px; margin: 0px; border: 0px none initial;" title="adminer" src="http://www.mahbubblog.com/wp-content/uploads/2009/09/adminer-300x117.jpg" alt="adminer" width="300" height="117" /></a></p>
<p>Alright, you pretty know what to do with those up and down arrows now. Don&#8217;t forget to save the changes <img src='http://www.mahbubblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/sorting-table-columns-in-mysql-by-adminer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Killing session on browser close in Codeigniter</title>
		<link>http://www.mahbubblog.com/php/killing-session-on-browser-close-in-codeigniter/</link>
		<comments>http://www.mahbubblog.com/php/killing-session-on-browser-close-in-codeigniter/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 02:41:06 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[browser close]]></category>
		<category><![CDATA[codeigniter session]]></category>
		<category><![CDATA[session killing]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=203</guid>
		<description><![CDATA[It may be well known to some people how to kill sessions on browser close but the default config in codeigniter doesn&#8217;t provide so. In lot of application which has admin interface, we don&#8217;t want browser to store the session. So it needs to kill the session when browser is closed. Example behavior can be [...]]]></description>
			<content:encoded><![CDATA[<p>It may be well known to some people how to kill sessions on browser close but the default config in codeigniter doesn&#8217;t provide so. In lot of application which has admin interface, we don&#8217;t want browser to store the session. So it needs to kill the session when browser is closed. Example behavior can be found in yahoo email page.</p>
<p>So how do we do that in Codeigniter ? It&#8217;s simple, although this feature is not well commented or documented. Ok, now open system/application/config/config.php file</p>
<p>And find the settings called<strong> $config['sess_expiration'] </strong>unde<strong>r </strong>the section <strong>Session Variables </strong>and put the value like this</p>
<pre class="brush: php">

$config[&#039;sess_expiration&#039;]        = -1;
</pre>
<p>That&#8217;s it. Now your session will be killed in the event of browser closing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/killing-session-on-browser-close-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Form Validation Callbacks in HMVC in Codeigniter</title>
		<link>http://www.mahbubblog.com/php/form-validation-callbacks-in-hmvc-in-codeigniter/</link>
		<comments>http://www.mahbubblog.com/php/form-validation-callbacks-in-hmvc-in-codeigniter/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 09:13:57 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[callbacks]]></category>
		<category><![CDATA[form validation]]></category>
		<category><![CDATA[hmvc]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=190</guid>
		<description><![CDATA[Many of us are using the HMVC extension (Hierarchical Model View Controller) in codeigniter which is available. http://codeigniter.com/wiki/Modular_Extensions_-_HMVC HMVC helps developing modular apps in a very convenient way. All the things work simply fine just like a clean CI installation. There&#8217;re 1 or two exceptions which i have found. One is the callback of Form_validation [...]]]></description>
			<content:encoded><![CDATA[<p>Many of us are using the HMVC extension (Hierarchical Model View Controller) in codeigniter which is available. http://codeigniter.com/wiki/Modular_Extensions_-_HMVC</p>
<p>HMVC helps developing modular apps in a very convenient way. All the things work simply fine just like a clean CI installation. There&#8217;re 1 or two exceptions which i have found. One is the callback of Form_validation class. If we are making some forms like registration we check emails and usernames and we do it in the form validation class using callbacks. If we look at the basic callback structure when validating forms from CI documentation, it appears like.</p>
<pre class="brush: php">

&lt; ?php

class Form extends Controller
{

 function index()
 {
 $this-&gt;load-&gt;helper( array (

 &#039;form&#039;,
 &#039;url&#039;
 ) );

 $this-&gt;load-&gt;library( &#039;form_validation&#039; );

 $this-&gt;form_validation-&gt;set_rules( &#039;username&#039;, &#039;Username&#039;, &#039;callback_username_check&#039; );
 $this-&gt;form_validation-&gt;set_rules( &#039;password&#039;, &#039;Password&#039;, &#039;required&#039; );
 $this-&gt;form_validation-&gt;set_rules( &#039;passconf&#039;, &#039;Password Confirmation&#039;, &#039;required&#039; );
 $this-&gt;form_validation-&gt;set_rules( &#039;email&#039;, &#039;Email&#039;, &#039;required&#039; );

 if ($this-&gt;form_validation-&gt;run() == FALSE)
 {
 $this-&gt;load-&gt;view( &#039;myform&#039; );
 }
 else
 {
 $this-&gt;load-&gt;view( &#039;formsuccess&#039; );
 }
 }

 function username_check($str)
 {
 if ($str == &#039;test&#039;)
 {
 $this-&gt;form_validation-&gt;set_message( &#039;username_check&#039;, &#039;The %s field can not be the word &quot;test&quot;&#039; );
 return FALSE;
 }
 else
 {
 return TRUE;
 }
 }

}
?&gt;
</pre>
<p><span style="font-size: small;"><span style="font-family: verdana,geneva;"><span style="color: #143270; white-space: pre-wrap;">But this callback will not simply work. Some of my precious hours went why it was not working. Then i navigated the Form_validation.php in /system/libraries folder around line 580 which looks like </span></span></span></p>
<p><span style="font-size: small;"><span style="font-family: verdana,geneva;"><span style="color: #143270; white-space: pre-wrap;"><br />
</span></span></span></p>
<p><span style="color: #143270; font-family: 'Lucida Grande'; font-size: 14px; white-space: pre-wrap;"> </span></p>
<pre class="brush: php">
if ($callback === TRUE)
 {
 if ( ! method_exists($this-&gt;CI, $rule))
 {
 continue;
 }
</pre>
<p><span style="font-size: small;"><span style="color: #143270; font-family: 'Lucida Grande'; white-space: pre-wrap;"><span style="font-family: verdana,geneva;">The function &#8211; <strong>method_exists</strong> returns false even if the callback function is there in the Controller and after all in the CI loader object. So it came out from the forum that you have to do a little extension to Form Validation class which is </span></span></span></p>
<pre class="brush: php">
&lt; ?php if (!defined(&#039;BASEPATH&#039;)) exit(&#039;No direct script access allowed&#039;);

class MY_Form_validation extends CI_Form_validation
{
 function run($module = &#039;&#039;, $group = &#039;&#039;) {
 (is_object($module)) AND $this-&gt;CI =&amp; $module;
 return parent::run($group);
 }
}
/* End of file MY_Form_validation.php */
/* Location: ./application/libraries/MY_Form_validation.php */
</pre>
<p>And when running the validation like in earlier code</p>
<pre class="php"> if ($this-&gt;form_validation-&gt;run() == FALSE)</pre>
<p>you have to provide an addition $this as a parameter to run method. which will look like</p>
<pre class="php"> if ($this-&gt;form_validation-&gt;run(<strong>$this</strong>) == FALSE)</pre>
<p>Now, you validation callbacks will work perfectly.</p>
<p>Another note, if you&#8217;re trying to access a public variable of a controller via the get_instance() in hooks , you&#8217;ll have to write in your controller like this.</p>
<p>CI::instance()-&gt;var_name = &#8220;Some Value&#8221;;</p>
<p>May be there are some other required adjustments when using HMVC, but i came across this two time killing adjustments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/form-validation-callbacks-in-hmvc-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Upload all your files in lowercase in Codeigniter</title>
		<link>http://www.mahbubblog.com/php/upload-all-your-files-i-lowercase-in-codeigniter/</link>
		<comments>http://www.mahbubblog.com/php/upload-all-your-files-i-lowercase-in-codeigniter/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 08:12:04 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=130</guid>
		<description><![CDATA[You might all probably know that *nix systems treat myPic.jpg and MYpic.jpg different while windows systems don&#8217;t . So there&#8217;s always been a need to deal with filenames across different systems. We upload files which may be in lower case, uppercase or a mixture of both. This sometimes kills our valuable time and effort. To deal [...]]]></description>
			<content:encoded><![CDATA[<p>You might all probably know that *nix systems treat myPic.jpg and MYpic.jpg different while windows systems don&#8217;t . So there&#8217;s always been a need to deal with filenames across different systems. We upload files which may be in lower case, uppercase or a mixture of both. This sometimes kills our valuable time and effort. To deal with files uploading, edit and delete if we always assume that file names are in lowercase, it&#8217;s lot better unless we have significant reasons to keep the case of the files intact.   Codeigniter has a good uploading library which resides at <strong>/system/libraries/Upload.php</strong>. But unfortunately there&#8217;s no property of the uploading class that lets us to upload the file in lower case. So, the shortcut is to override the native method by your own library. When we initialize a library CI tries to find it within your application directory and then it&#8217;s System directory. So if we make a class <strong>MY_Upload </strong>extending <strong>CI_Upload</strong>, it can do the job. This is no trick, it&#8217;s documented on CI. So, now , we just need to override two functions in the <strong>CI_Upload</strong> class. These are <strong>_prep_filename </strong>and <strong>get_extension</strong> Here is how it looks</p>
<pre class="brush: php">

&lt; ?php
// For overriding Native class to  convert filenames to lowercase.
class MY_Upload extends CI_Upload
{
function _prep_filename($filename)
{
if (strpos($filename, &#039;.&#039;) === false)
{
return $filename;
}

$parts = explode(&#039;.&#039;, $filename);
$ext = array_pop($parts);
$filename = array_shift($parts);

foreach ($parts as $part)
{
if ($this-&gt;mimes_types(strtolower($part)) === false)
{
$filename .= &#039;.&#039; . $part . &#039;_&#039;;
}
else
{
$filename .= &#039;.&#039; . $part;
}
}

$filename .= &#039;.&#039; . $ext;

return strtolower($filename);
}
function get_extension($filename)
{
$x = explode(&#039;.&#039;, $filename);
return strtolower(&#039;.&#039;.end($x));
}
}
</pre>
<p>The code can be downloaded from here</p>
<p><a href="http://www.mahbubblog.com/wp-content/uploads/2009/03/my_upload.zip">my_upload</a></p>
<p>Unzip and put it in your /system/application/libraries directory.</p>
<p>Now for any upload you do using CI&#8217;s uploading class, will produce lowercased filenames.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/upload-all-your-files-i-lowercase-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is Kohana moving faster than Codeigniter ?</title>
		<link>http://www.mahbubblog.com/php/is-kohana-moving-faster-than-codeigniter/</link>
		<comments>http://www.mahbubblog.com/php/is-kohana-moving-faster-than-codeigniter/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 05:09:06 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[alexa]]></category>
		<category><![CDATA[beyondcoding]]></category>
		<category><![CDATA[kohanaphp]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=127</guid>
		<description><![CDATA[Look at the Alexa graph above. What do u think ? &#160; I&#8217;ve been using Codeigniter in Mid and Fairly Big project for over a year and a half. Kohana was released before i started but the amount of online support and tutorials and an active company development (EllisLab) made me decide using CodeIgniter. But [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.mahbubblog.com/wp-content/uploads/2009/03/ci-vs-kohana.jpg"><img alt="Traffic Codeigniter VS KohanaPHP" title="ci-vs-kohana" width="470" height="300" class="size-full wp-image-128" src="http://www.mahbubblog.com/wp-content/uploads/2009/03/ci-vs-kohana.jpg" /></a>
<p>Look at the Alexa graph above. What do u think ? &nbsp;</p>
<p>I&#8217;ve been using Codeigniter in Mid and Fairly Big project for over a year and a half. Kohana was released before i started but the amount of online support and tutorials and an active company development (EllisLab) made me decide using CodeIgniter. But I keep checking updates on Kohana because it has lot of extra features over CI. It&#8217;s Strictly PHP5 OOP and has libraries like ORM which doesn&#8217;t exist CI&#8217;s distribution. Just out of curiosity, i went to Alexa and compared the traffic for CI and KohanaPHP and it really surprised me. Kohana is way ahead in terms of traffic. What does that mean? People are more involved with Kohana than CI ? Well, apparently YES. Kohana is community driven development. In CI, user contributes as addons to the Framework, which is ok. But when there&#8217;s an active driving force by the community, it&#8217;s better, at least i think.&nbsp;</p>
<p>Moreover I read some articles how to easily use Zend in Kohana in the beyondcoding.com. So that makes me think of leaning towards Kohana for my next projects.&nbsp;There are of course ways to use CI with Zend though but the integration method of Kohana with Zend looked neat.&nbsp;It won&#8217;t get much tough to switch to Kohana because it was originally based on CI. And default design pattern in Kohana is Factory (as it appears) while CI is singleton. Of course I&#8217;ll need to analyze some more benchmarks for scalability and other features before shifting focus.&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/is-kohana-moving-faster-than-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PhpMinAdmin &#8211; nearest alternative to phpMyAdmin</title>
		<link>http://www.mahbubblog.com/php/phpminiadmin-nearest-alternative-to-phpmyadmin/</link>
		<comments>http://www.mahbubblog.com/php/phpminiadmin-nearest-alternative-to-phpmyadmin/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 10:25:28 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[adminer]]></category>
		<category><![CDATA[dbadmin]]></category>
		<category><![CDATA[phpminadmin]]></category>
		<category><![CDATA[phpminiadmin]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=119</guid>
		<description><![CDATA[I can&#8217;t possibly tell how many times i&#8217;ve been seriously irritated  navigating to phpmyadmin option of my hosting or hostings of the projects i have worked with. Most of the cases you&#8217;ll have to click many times. And in Plesk ? It simply sucks when it comes to use phpMyAdmin from there. I&#8217;ve always used [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t possibly tell how many times i&#8217;ve been seriously irritated  navigating to phpmyadmin option of my hosting or hostings of the projects i have worked with. Most of the cases you&#8217;ll have to click many times. And in Plesk ? It simply sucks when it comes to use phpMyAdmin from there. I&#8217;ve always used phpminiadmin as a quick alternative solution because it needs no configuration and no install. But it&#8217;s very basic and needs too much typing to get things done. Today I found phpminadmin. It&#8217;s just the name without the <strong>i </strong>in php phpmin<strong><span style="color: #ff0000; ">i</span></strong>admin. It simply rocks!! It has nearly every option that you&#8217;d normally expect from a db admin tool. And to me, it&#8217;s a substitute to phpmyadmin for ongoing operations.</p>
<p><a href="http://www.mahbubblog.com/wp-content/uploads/2009/03/phpminadmin.png"><img class="size-medium wp-image-120" title="phpminadmin" src="http://www.mahbubblog.com/wp-content/uploads/2009/03/phpminadmin-300x160.png" alt="phpminadmin screenshot" width="300" height="160" /></a></p>
<p>It has select, search, edit, index , create &#8212; almost everything u need. The best part is that it needs no install and it&#8217;s a single file weighing about 167KB.</p>
<p>But of course, i&#8217;m not saying it&#8217;s a fully alternative to phpmyadmin. No way. They have been developing this mighty tool for over nine years.  But phpminadmin surely is a very very good altenative of that for quick solutions. Check it out here.</p>
<p><a href="http://phpminadmin.sourceforge.net/" target="_blank">http://phpminadmin.sourceforge.net/</a></p>
<p>Why didn&#8217;t I find it earlier ?  :-(</p>
<p><strong>UPDATE : THE PROJECT HAS BEEN RENAMED TO &#8220;adminer&#8221; AND IS AVAILABLE at </strong><a href="http://www.adminer.org/en/"><strong>http://www.adminer.org/en/</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/phpminiadmin-nearest-alternative-to-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Always use meaningful variable and function names in PHP</title>
		<link>http://www.mahbubblog.com/php/always-use-meaningful-variable-and-function-names-in-php/</link>
		<comments>http://www.mahbubblog.com/php/always-use-meaningful-variable-and-function-names-in-php/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 09:00:28 +0000</pubDate>
		<dc:creator>Mahbub</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[meaningful variable]]></category>

		<guid isPermaLink="false">http://www.mahbubblog.com/?p=34</guid>
		<description><![CDATA[Think About the following code $a=&#8221;I Am John Doe&#8221;; $b=explode(&#8220; &#8220;,$a); echo &#8220;Total Number of words in $a is &#8220;.count($b); Now how about this, $name=&#8221;I Am John Doe&#8221;; $num_of_words=explode(&#8220; &#8220;,$a); echo &#8220;Total Number of words in $name is &#8220;.count($num_of_words); Well, the example was too simple. But things can go terribly wrong when not using meaningful [...]]]></description>
			<content:encoded><![CDATA[<p>Think About the following code  <span style="font-family: Courier New;">$a=&rdquo;I Am John Doe&rdquo;;</span><br style="font-family: Courier New;" /><br />
<span style="font-family: Courier New;">$b=explode(&ldquo; &ldquo;,$a);</span><br style="font-family: Courier New;" /><br />
<span style="font-family: Courier New;">echo &ldquo;Total Number of words in $a is &ldquo;.count($b);</span><br style="font-family: Courier New;" /><br />
Now how about this,  <span style="font-family: Courier New;">$name=&rdquo;I Am John Doe&rdquo;;</span><br style="font-family: Courier New;" /><br />
<span style="font-family: Courier New;">$num_of_words=explode(&ldquo; &ldquo;,$a);</span><br style="font-family: Courier New;" /><br />
<span style="font-family: Courier New;">echo &ldquo;Total Number of words in $name is &ldquo;.count($num_of_words);</span>  Well, the example was too simple. But things can go terribly wrong when not using meaningful variable names in PHP or any other language&#8217;s codes. Even you&#8217;ll forget at some point of time what was the variable $a for and $b. And it really pisses other developers when using some one&#8217;s code which didn&#8217;t follow good naming convention. And when i see codes in those messy fashion it makes me angry like the Goku below.<br />
<a href="http://www.mahbubblog.com/wp-content/uploads/2009/03/angry_goku_by_psycho_slayer.jpg"><img height="311" width="300" src="http://www.mahbubblog.com/wp-content/uploads/2009/03/angry_goku_by_psycho_slayer.jpg" alt="Angry Goku" title="angry_goku_by_psycho_slayer" class="size-full wp-image-66" /></a></p>
<p>And the end result is inefficiency and waste of valuable time.  There are various naming conventions practiced for coding. PHP has it&#8217;s own style where underscore is massively used. And it&#8217;s quite comfortable to use. $last_name is more readable than $lastname. So variables/functions can be made quite meaningful when they are written. To cut the story short, here&#8217;s some suggestions from me:&nbsp;</p>
<p><span id="more-34"></span></p>
<ul>
<li><span style="font-weight: bold;">Always use lower case in functions and variables unless specifically asked by Frameworks. Like</span> <span style="font-family: Courier New;">function Login() </span><br style="font-family: Courier New;" /><br />
    <span style="font-family: Courier New;"> function login()</span></li>
</ul>
<ul>
<li><span style="font-weight: bold;">Functions/Variable separators should be with underscores. e.g </span> <span style="font-family: Courier New;">function get_users()..</span><br style="font-family: Courier New;" /><br />
    <span style="font-family: Courier New;">function getUsers() // It&rsquo;s better to avoid Camelize </span></li>
</ul>
<ul>
<li><span style="font-weight: bold;">Function names should be grammatically sensible. For example if we want a function that returns all the countries of the world, we should name it like</span> <span style="font-family: Courier New;">function get_all_countries().</span><br style="font-family: Courier New;" /><br />
    <span style="font-family: Courier New;">function get_all_country()..&nbsp;// wrong plural </span><br style="font-family: Courier New;" /><br />
    <span style="font-family: Courier New;">function get_country_all()..&nbsp;// Hard to make sense what this means</span></li>
<li style="font-weight: bold;">Be consistent with one practice throughout the whole project so that other people can confortably assume the convention.</li>
<li style="font-weight: bold;">If possible keep signature of datatypes or return types in variable function name. Like if we want to store users as an array in a variable it should be $user_array instead of $users</li>
<li><span style="font-weight: bold;">Using imperatives. Meaning put some verbs in functions to know what the function is doing. Instead of function notes(), try to write function get_notes(); which is kind of self explaining.</span></li>
<li style="font-weight: bold;">Avoid homophones: e.g., foo, fu, phoo, etc.</li>
<li style="font-weight: bold;">Avoid generic names such as tmp, buf, reg.</li>
<li style="font-weight: bold;">Avoid intentionally misspelled words such as lo or lite.</li>
</ul>
<p>Well, there can be many more suggestions for better coding, because &quot;coding is poetry&quot; for programmers.</p>
<div class="zemanta-pixie"><img alt="" src="http://img.zemanta.com/pixy.gif?x-id=34c7b094-453a-4086-a72d-3e2c6d45ad60" class="zemanta-pixie-img" /></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mahbubblog.com/php/always-use-meaningful-variable-and-function-names-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
