<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6925309688585982497</id><updated>2024-09-12T22:42:09.151-07:00</updated><category term="SQL"/><category term="PHP"/><category term="Joomla"/><category term="Zend Framework"/><category term="CentOS"/><category term="General Tips"/><category term="Regex"/><category term="htaccess"/><title type='text'>Developer Tips</title><subtitle type='html'>sharing some useful programming tips with other developers.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default?start-index=26&amp;max-results=25'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-3073142354437103770</id><published>2014-03-18T20:47:00.001-07:00</published><updated>2014-03-18T20:47:57.676-07:00</updated><title type='text'>How to do a System Restore from Safe Mode (Windows 7)</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;344&quot; src=&quot;//www.youtube.com/embed/JCnUu_118Vk&quot; width=&quot;459&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/3073142354437103770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/3073142354437103770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/3073142354437103770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/3073142354437103770'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2014/03/how-to-do-system-restore-from-safe-mode.html' title='How to do a System Restore from Safe Mode (Windows 7)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-5094867709649842694</id><published>2012-08-21T19:41:00.001-07:00</published><updated>2012-08-21T19:41:38.942-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'></title><content type='html'>MySQL can be used to do some string replacements rather using any programming languages.

The following is used to replace space with hyphen in list names&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;sql&quot; name=&quot;code&quot;&gt;

UPDATE list SET list_name =
REPLACE(list_name, &#39; &#39;, &#39;-&#39;)
WHERE list_name LIKE &#39;% %&#39;;

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/5094867709649842694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/5094867709649842694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/5094867709649842694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/5094867709649842694'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2012/08/mysql-can-be-used-to-do-some-string.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-7497103012993697370</id><published>2012-08-13T06:35:00.001-07:00</published><updated>2012-08-13T06:37:18.085-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Zend Form Validator check record exists</title><content type='html'>User registration form is a good example for this validator. Checking the username exists or not.
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Db_NoRecordExists&lt;/b&gt; validator helps to achieve this 
&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;
$username = new Zend_Form_Element_Text(&#39;username&#39;,
 array(&#39;label&#39; =&amp;gt; &#39;Username&#39;,
     &#39;required&#39; =&amp;gt; true,
     &#39;filters&#39; =&amp;gt; array(&#39;StripTags&#39;, &#39;StringTrim&#39;),         
     &#39;validators&#39; =&amp;gt; array(&#39;NotEmpty&#39;, array(&#39;Db_NoRecordExists&#39;,false,array(
  &#39;users_table&#39;,&#39;username_column&#39;, &#39;messages&#39; =&amp;gt; array( Zend_Validate_Db_Abstract::ERROR_RECORD_FOUND =&amp;gt; &#39;%value% already exists&#39;)
 )))));
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/7497103012993697370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/7497103012993697370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7497103012993697370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7497103012993697370'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2012/08/zend-form-validator-check-record-exists.html' title='Zend Form Validator check record exists'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-3504592347963445177</id><published>2012-06-19T08:08:00.000-07:00</published><updated>2012-06-19T08:11:07.831-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General Tips"/><title type='text'>How to Load Putty Session in Connection Manager</title><content type='html'>If your Putty Connection Manager doesn&#39;t load Putty inside the Manager then do this :&lt;br&gt;&lt;br&gt;

1. &lt;b&gt;Go to View -&gt; Connection Manager&lt;/b&gt;&lt;br&gt;

2. &lt;b&gt;Right Click in side the right panel -&gt; create a Database ( give any name )&lt;/b&gt;&lt;br&gt;&lt;br&gt;

That will create SSH and Telnet folders&lt;br&gt;&lt;br&gt;

3. &lt;b&gt;Right Click on SSH folder and then New -&gt; Connection Manager&lt;/b&gt;&lt;br&gt;

4. &lt;b&gt;Add Host Name  and select SSH protocol&lt;/b&gt;&lt;br&gt;

5. &lt;b&gt;File -&gt; Save All Databases&lt;/b&gt;&lt;br&gt;&lt;br&gt;

You are done now.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/3504592347963445177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/3504592347963445177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/3504592347963445177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/3504592347963445177'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2012/06/how-to-load-putty-session-in-connection.html' title='How to Load Putty Session in Connection Manager'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-8788048934107688137</id><published>2012-06-06T08:36:00.003-07:00</published><updated>2012-06-06T08:49:16.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>Execute system commands from PHP</title><content type='html'>System commands can be executed from PHP using exec command.
&lt;br /&gt;
eg:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$out = array();
$command = &quot;memcat --server=10.10.10.10 ITEMS &amp;gt; /tmp/items.txt&quot;;&lt;br&gt;
exec($command, $out);&lt;br&gt;

&lt;/pre&gt;

The $out variable would hold the output of the command.

If there is any issue with executing a command , have the command with path.

&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
eg:
$command = &quot;/usr/local/bin/memcat --server=10.10.10.10 ITEMS &amp;gt; /tmp/items.txt&quot;;&lt;br&gt;
exec($command, $out);&lt;br&gt;

&lt;/pre&gt;


for further info:
http://www.php.net/manual/en/function.exec.php&lt;/pre&gt;

</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/8788048934107688137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/8788048934107688137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/8788048934107688137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/8788048934107688137'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2012/06/execute-system-commands-from-php.html' title='Execute system commands from PHP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-1675999957053020895</id><published>2011-08-31T15:10:00.000-07:00</published><updated>2011-08-31T15:14:10.652-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Zend Db Select with like</title><content type='html'>Like keyword can be used with Zend_Db select query&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;sql&quot;&gt;&lt;br /&gt;$query = $this-&gt;select()&lt;br /&gt;           -&gt;where(&quot;firstname like ?&quot;, $letter.&quot;%&quot;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;try that works.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/1675999957053020895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/1675999957053020895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/1675999957053020895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/1675999957053020895'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/08/zend-db-select-with-like.html' title='Zend Db Select with like'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-621361821790115198</id><published>2011-08-17T18:30:00.000-07:00</published><updated>2011-08-17T18:35:56.501-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQL to select comma separated data from table</title><content type='html'>There is a way to select comma separated data from any mysql table.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;sql&quot;&gt;&lt;br /&gt;SELECT poll_id,group_concat(option_id) FROM `poll_elements` &lt;br /&gt;group by poll_id&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;this will output as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;poll_id | group_concat(option_id)&lt;br /&gt;1 | 3855,5098,8474&lt;br /&gt;3 | 3855,9469,15677&lt;br /&gt;6 | 509,3855,9469,10489&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/621361821790115198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/621361821790115198' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/621361821790115198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/621361821790115198'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/08/sql-to-select-comma-separated-data-from.html' title='SQL to select comma separated data from table'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-4085112032031014735</id><published>2011-06-24T16:33:00.000-07:00</published><updated>2011-06-24T16:38:18.241-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Zend Form - Adding a hidden field without decorators</title><content type='html'>If the hidden field added to the Zend form leaves extra space between elements, remove those tags around it.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$this-&gt;addElement(&quot;hidden&quot;, &quot;id&quot;, &lt;br /&gt;                   array(&#39;disableLoadDefaultDecorators&#39; =&gt; true));&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That will do it.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/4085112032031014735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/4085112032031014735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/4085112032031014735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/4085112032031014735'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/06/zend-form-adding-hidden-field-without.html' title='Zend Form - Adding a hidden field without decorators'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-7625960289174586520</id><published>2011-06-21T15:17:00.000-07:00</published><updated>2011-06-21T15:22:37.999-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Select records from tables of different databases</title><content type='html'>This is the way to select records from tables of different databases&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;sql&quot;&gt;&lt;br /&gt;SELECT * FROM `db`.table tb&lt;br /&gt;INNER JOIN `db2`.table2 tb2 ON tb2.id = tb.id&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hope it helps someone.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/7625960289174586520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/7625960289174586520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7625960289174586520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7625960289174586520'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/06/select-records-from-tables-of-different.html' title='Select records from tables of different databases'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-5285247863210999005</id><published>2011-06-19T07:35:00.000-07:00</published><updated>2011-06-19T08:15:05.420-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Zend Form - Adding Custom Error Messges to element</title><content type='html'>Custom error messages can be added to a form element:&lt;br /&gt;&lt;br /&gt;The following shows how to add custom error message to a select element&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;$countryList = array(&quot;0&quot; =&gt; &quot;select&quot; ,&quot;1&quot; =&gt; &quot;Canada&quot;, &quot;2&quot; =&gt; &quot;India&quot;, &quot;3&quot; =&gt; &quot;America&quot;);&lt;br /&gt;$countries = new Zend_Form_Element_Select(&#39;country&#39;);&lt;br /&gt;$countries-&gt;setLabel(&quot;Country&quot;)&lt;br /&gt;     -&gt;setRequired(true)&lt;br /&gt;     -&gt;addFilter(&#39;Int&#39;)     &lt;br /&gt;     -&gt;addMultiOptions($countryList)&lt;br /&gt;     -&gt;addValidator(&#39;GreaterThan&#39;,false, array(&quot;min&quot;=&gt;1, &quot;messages&quot; =&gt; array(&quot;notGreaterThan&quot;=&gt;&quot;country is required&quot;)));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;validator name = GreaterThan&lt;br /&gt;message for = notGreaterThan ( get it from validator library file or api doc)&lt;br /&gt;&lt;br /&gt;The customr error message will display now.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/5285247863210999005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/5285247863210999005' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/5285247863210999005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/5285247863210999005'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/06/adding-custom-error-messges-to-zend.html' title='Zend Form - Adding Custom Error Messges to element'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-4595710042343157832</id><published>2011-03-12T00:54:00.000-08:00</published><updated>2011-03-12T00:59:04.756-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>Merging two arrays without changing numeric keys</title><content type='html'>Merge two arrays together using array_merge function&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$result = array_merge(array(0=&gt;&quot;Hello&quot;), array(3=&gt;&quot;World&quot;));&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The result will have an array with keys got re-numbered&lt;br /&gt;therefore the key 3 will be changed to 1.&lt;br /&gt;&lt;br /&gt;If you want to keep your array keys unchanged&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$result = $arr1 + $arr2;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That will do it.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/4595710042343157832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/4595710042343157832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/4595710042343157832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/4595710042343157832'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/03/merging-two-arrays-without-changing.html' title='Merging two arrays without changing numeric keys'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-254141179820561278</id><published>2011-02-18T05:13:00.000-08:00</published><updated>2011-02-18T05:15:35.930-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Zend Form - make a text field read only</title><content type='html'>A text element of a form can be made read only therefore user cannot touch the value&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$this-&gt;addElement(&#39;text&#39;,&#39;current_date&#39;,array(            &lt;br /&gt;            &#39;attribs&#39; =&gt; array(&#39;readonly&#39; =&gt; &#39;true&#39;)));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;that will do it.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/254141179820561278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/254141179820561278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/254141179820561278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/254141179820561278'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/02/zend-form-make-text-field-read-only.html' title='Zend Form - make a text field read only'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-5049840892879848379</id><published>2011-02-18T05:07:00.000-08:00</published><updated>2011-02-18T05:11:45.976-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Zend Framework - Fetch rows in key value pair</title><content type='html'>If you happened to select records in key value pair, try this way&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$query = $this-&gt;select()&lt;br /&gt;-&gt;from($this-&gt;_name, array(&#39;id&#39;, &#39;name&#39;));&lt;br /&gt;&lt;br /&gt;$this-&gt;getAdapter()-&gt;fetchPairs($query);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;that will return &lt;br /&gt;222 =&gt; &quot;Velvom&quot;</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/5049840892879848379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/5049840892879848379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/5049840892879848379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/5049840892879848379'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/02/zend-framework-fetch-rows-in-key-value.html' title='Zend Framework - Fetch rows in key value pair'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-2401772213586760324</id><published>2011-02-09T17:08:00.001-08:00</published><updated>2011-02-09T17:11:06.150-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>MySQL Update on Same Table</title><content type='html'>If any chance to do an UPDATE on the same table, here is the SQL for that&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;sql&quot;&gt;&lt;br /&gt;&lt;br /&gt;UPDATE my_list AS a &lt;br /&gt;INNER JOIN my_list AS b &lt;br /&gt;ON a.id = b.id &lt;br /&gt;SET a.list_name_val = md5( b.list_name )&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;the above SQL will update list_name_val column with md5 of list_name.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/2401772213586760324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/2401772213586760324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/2401772213586760324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/2401772213586760324'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2011/02/mysql-update-on-same-table.html' title='MySQL Update on Same Table'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-8686923796355694519</id><published>2010-11-01T18:44:00.000-07:00</published><updated>2010-11-01T18:52:50.919-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Joomla"/><title type='text'>Let User Selects Language in Joomla 1.5</title><content type='html'>If you&#39;d like to let visitors select their language on your site, do the following in your index.php file&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$lang_request = JRequest::getWord(&#39;lang&#39;); &lt;br /&gt;$lang_choice = implode(&quot;-&quot;, str_split($lang_request, 2));&lt;br /&gt;$currentSession = JFactory::getSession();&lt;br /&gt;&lt;br /&gt;if(!empty($lang_choice))&lt;br /&gt;{&lt;br /&gt; $currentSession-&gt;set(&quot;langChoice&quot;,$lang_choice); &lt;br /&gt; $lang =&amp; JFactory::getLanguage();&lt;br /&gt; $lang-&gt;setLanguage( $lang_choice );&lt;br /&gt; $lang-&gt;load();&lt;br /&gt;}&lt;br /&gt;elseif($currentSession-&gt;getState())&lt;br /&gt;{ &lt;br /&gt; $lang =&amp; JFactory::getLanguage();&lt;br /&gt; $lang-&gt;setLanguage( $currentSession-&gt;get(&quot;langChoice&quot;) );&lt;br /&gt; $lang-&gt;load();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;when user clicks on a link have your url like the following:&lt;br /&gt;http://www.yoursite.com/?lang=de-DE or /?lang=en-GB&lt;br /&gt;&lt;br /&gt;the lang would be stored in session so you don&#39;t need to worry about it anymore.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/8686923796355694519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/8686923796355694519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/8686923796355694519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/8686923796355694519'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2010/11/let-user-selects-language-in-joomla-15.html' title='Let User Selects Language in Joomla 1.5'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-6034096826562450990</id><published>2010-03-11T16:10:00.000-08:00</published><updated>2010-03-11T16:17:37.258-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Get SQL out of Zend select object</title><content type='html'>To display SQL of Zend_Db_Select object, try this &lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;$query = $this-&gt;select()&lt;br /&gt;                    -&gt;where(&quot;permitted = &#39;Y&#39;&quot;)&lt;br /&gt;                    -&gt;order(&quot;id DESC&quot;)&lt;br /&gt;                    -&gt;limit($count);&lt;br /&gt;&lt;br /&gt;echo $query-&gt;__toString();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;that will do it.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/6034096826562450990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/6034096826562450990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/6034096826562450990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/6034096826562450990'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2010/03/get-sql-out-of-zend-select-object.html' title='Get SQL out of Zend select object'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-2539830610647944235</id><published>2010-01-02T15:00:00.000-08:00</published><updated>2010-01-02T15:05:57.185-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Joomla"/><title type='text'>Add Select option to your Joomla select list</title><content type='html'>If you like to add &#39;Select Category&#39; option to the option list you got from DB. &lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$db    =&amp; JFactory::getDBO();&lt;br /&gt;$query = &quot;SELECT id as value,name as text FROM  categories WHERE parent_id &gt; 0 ORDER BY name&quot;;&lt;br /&gt;$db-&gt;setQuery($query);&lt;br /&gt;$categories = $db-&gt;loadAssocList(); &lt;br /&gt;$begin_categories = array(array(&quot;value&quot;=&gt;0,&quot;text&quot;=&gt;&quot;Select Category&quot;));&lt;br /&gt;$categories = array_merge($begin_categories,$categories);&lt;br /&gt;$lists[&#39;categories&#39;] = JHTML::_(&#39;select.genericlist&#39;,  $categories, &#39;categories&#39;, &#39;class=&quot;inputbox&quot; size=&quot;1&quot;&#39;, &#39;value&#39;, &#39;text&#39;, null);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I am not sure any better way to do with Joomla classes.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/2539830610647944235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/2539830610647944235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/2539830610647944235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/2539830610647944235'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2010/01/add-select-option-to-your-joomla-select.html' title='Add Select option to your Joomla select list'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-7803309817652188082</id><published>2010-01-02T10:44:00.000-08:00</published><updated>2010-01-02T10:59:02.731-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Joomla"/><title type='text'>How to add jQuery to Joomla ?</title><content type='html'>The Joomla 1.5 is coming with Mootools therefore you might experience some conflict with jQuery now.&lt;br /&gt;Just follow the way below to avoid any conflicts. Add the following lines to your view.html.php.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$document = &amp;JFactory::getDocument();&lt;br /&gt;$document-&gt;addScript( &#39;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&#39; );&lt;br /&gt;$document-&gt;addCustomTag( &#39;&lt;script type=&quot;text/javascript&quot;&gt;jQuery.noConflict();&lt;/script&gt;&#39; ); &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above code fragment would solve your problem.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/7803309817652188082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/7803309817652188082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7803309817652188082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7803309817652188082'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2010/01/how-to-add-jquery-to-joomla.html' title='How to add jQuery to Joomla ?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-7399569581522796895</id><published>2010-01-02T10:39:00.001-08:00</published><updated>2010-01-02T10:59:30.444-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Joomla"/><title type='text'>How to add Javascript / css to Joomla?</title><content type='html'>How to add Javascript or css to your Joomla template?&lt;br /&gt;&lt;br /&gt;Just do the following to get it working. Add the following lines to your view.html.php.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$document = &amp;JFactory::getDocument();&lt;br /&gt;$this-&gt;document-&gt;addStyleSheet(&#39;your path/style.css&#39;);&lt;br /&gt;$this-&gt;document-&gt;addScript( &#39;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&#39; );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That would solve your problem.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/7399569581522796895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/7399569581522796895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7399569581522796895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7399569581522796895'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2010/01/how-to-add-javascript-css-to-joomla.html' title='How to add Javascript / css to Joomla?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-4526637779717153640</id><published>2009-11-07T15:58:00.000-08:00</published><updated>2009-11-07T16:05:05.687-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Joomla"/><title type='text'>Adding a calendar / date picker to Joomla form</title><content type='html'>This is how you add a calendar / date picker to Joomla form.&lt;br /&gt;&lt;br /&gt;add the following code to your &lt;br /&gt;xx.html.php class&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$document = &amp;JFactory::getDocument();&lt;br /&gt;$document-&gt;addScript(&quot;includes/js/joomla.javascript.js&quot;);&lt;br /&gt;&lt;br /&gt;JHTML::_(&#39;behavior.calendar&#39;);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and add the following code to the default.php template file &lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;dateofbirth&quot; id=&quot;dob&quot; size=&quot;15&quot; maxlength=&quot;25&quot; value=&quot;&quot; class=&quot;inputbox required&quot; /&gt; &lt;br /&gt;&lt;input type=&quot;reset&quot; class=&quot;button&quot; value=&quot;...&quot; onclick=&quot;return showCalendar(&#39;dob&#39;,&#39;%d/%m/%Y&#39;);&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;All those codes above will have a calendar / date picker close to the input field.&lt;br /&gt;&lt;br /&gt;Enjoy your coding.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/4526637779717153640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/4526637779717153640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/4526637779717153640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/4526637779717153640'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2009/11/adding-calendar-date-picker-to-joomla.html' title='Adding a calendar / date picker to Joomla form'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-2296157329767734027</id><published>2009-11-03T13:42:00.000-08:00</published><updated>2009-11-03T13:48:01.102-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>Debugging view of 2D array</title><content type='html'>If you are in a position to have a better view of 2 dimensional array then try this &lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$fruits[&quot;apple&quot;] = array(&quot;Canada&quot;,&quot;US&quot;,&quot;Extra&quot;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;print_r($fruits) won&#39;t show a better view but the following way would show a clear view of arrays and values&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;echo &quot;&lt;pre&gt;&quot;;&lt;br /&gt;print_r($fruits);&lt;br /&gt;echo &quot;&lt;/pre&gt;&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;br /&gt;cheers.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/2296157329767734027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/2296157329767734027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/2296157329767734027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/2296157329767734027'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2009/11/debugging-view-of-2d-array.html' title='Debugging view of 2D array'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-9182871141517880100</id><published>2009-10-29T09:18:00.000-07:00</published><updated>2009-10-29T09:24:00.627-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="htaccess"/><title type='text'>Redirect dynamic URL using .htaccess</title><content type='html'>If you are trying to redirect a dynamic URL follow the steps to do it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;RewriteCond %{QUERY_STRING}  ^product_id=(.*)$&lt;br /&gt;RewriteRule ^product_view\.php$ /products/%1? [R=301,L]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The above statements would do the following,&lt;br /&gt;&lt;br /&gt;http://www.example.com/product_view.php?product_id=4 &lt;br /&gt;&lt;br /&gt;redirected to &lt;br /&gt;&lt;br /&gt;http://www.example.com/products/4&lt;br /&gt;&lt;br /&gt;Hope it helps someone. &lt;br /&gt;cheers.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/9182871141517880100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/9182871141517880100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/9182871141517880100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/9182871141517880100'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2009/10/redirect-dynamic-url-using-htaccess.html' title='Redirect dynamic URL using .htaccess'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-6379298832597293241</id><published>2009-09-07T12:46:00.000-07:00</published><updated>2010-01-02T11:33:09.618-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>select records whose id is not present in the other table</title><content type='html'>If you are trying to select records whose ids are not present in the other table,&lt;br /&gt;&lt;br /&gt;eg: articles table has article_id, categorized table has article_id and cat_id. &lt;br /&gt;If you are trying to select the article that is not categorized yet&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;sql&quot;&gt;&lt;br /&gt;&lt;br /&gt;SELECT * FROM articles WHERE article_id NOT IN ( SELECT article_id FROM categorized );&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That will solve your problem.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/6379298832597293241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/6379298832597293241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/6379298832597293241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/6379298832597293241'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2009/09/select-records-whose-id-is-not-present.html' title='select records whose id is not present in the other table'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-499461702644654844</id><published>2009-09-02T06:42:00.000-07:00</published><updated>2010-01-02T11:02:40.015-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQL to filter duplicate records</title><content type='html'>If you are trying to filter out duplicate records from your table.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;sql&quot;&gt;&lt;br /&gt;&lt;br /&gt;SELECT DISTINCT column_name,id FROM table_name &lt;br /&gt;GROUP BY coulumn_name&lt;br /&gt;HAVING COUNT(column_name) &gt; 1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above sql would filter out duplicate records with their ids.&lt;br /&gt;&lt;br /&gt;cheers.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/499461702644654844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/499461702644654844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/499461702644654844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/499461702644654844'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2009/09/sql-to-filter-duplicate-records.html' title='SQL to filter duplicate records'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6925309688585982497.post-7134935763632641371</id><published>2009-08-31T12:01:00.000-07:00</published><updated>2010-01-02T11:33:52.976-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQL to get count of records</title><content type='html'>This is for MySQL I have no idea about other DBs&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;&lt;br /&gt;$query = mysql_query(&quot;SELECT count(*) FROM accounts&quot;);&lt;br /&gt;$ctr = mysql_result($query,0,0);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Hope it helps someone.</content><link rel='replies' type='application/atom+xml' href='http://devtipsforu.blogspot.com/feeds/7134935763632641371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6925309688585982497/7134935763632641371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7134935763632641371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6925309688585982497/posts/default/7134935763632641371'/><link rel='alternate' type='text/html' href='http://devtipsforu.blogspot.com/2009/08/sql-to-get-count-of-records.html' title='SQL to get count of records'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/02146551609717603535</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>