<?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: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-25451963</id><updated>2011-05-23T08:18:24.677-07:00</updated><title type='text'>All About PHP</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-25451963.post-114587920046989017</id><published>2006-04-24T04:36:00.001-07:00</published><updated>2006-04-24T04:46:40.480-07:00</updated><title type='text'></title><content type='html'>Find numbers of day in a month&lt;br /&gt;&lt;br /&gt;Well, that may be a tricky question but if you are oversmart, well that is no problem at all. take a look at the following code&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;so do you get the point? when you just set the day=0, that also means the last day of previous month.&lt;br /&gt;&lt;br /&gt;Dont use "d" in your dateformat string cause it wont return the expected value for PHP 5.1.1 and laters. Use "t" which works pretty fine for all PHP versions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114587920046989017?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114587920046989017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114587920046989017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114587920046989017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114587920046989017'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/find-numbers-of-day-in-month-well-that_24.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114587905882719941</id><published>2006-04-24T04:36:00.000-07:00</published><updated>2006-04-24T04:44:19.036-07:00</updated><title type='text'></title><content type='html'>Find numbers of day in a month&lt;br /&gt;&lt;br /&gt;Well, that may be a tricky question but if you are oversmart, well that is no problem at all. take a look at the following code&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;?&lt;br /&gt;//total number of days in march, 2006&lt;br /&gt;echo Date("t",strtotime("04/0/2006"));&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;so do you get the point? when you just set the day=0, that also means the last day of previous month.&lt;br /&gt;&lt;br /&gt;Dont use "d" in your dateformat string cause it wont return the expected value for PHP 5.1.1 and laters. Use "t" which works pretty fine for all PHP versions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114587905882719941?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114587905882719941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114587905882719941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114587905882719941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114587905882719941'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/find-numbers-of-day-in-month-well-that.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114549976056814422</id><published>2006-04-19T19:12:00.000-07:00</published><updated>2006-04-19T19:28:18.563-07:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Creating Action Queue for AJAX Calls&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In ajax, there are several cases where you need to call a bunch of actions synchronously. That means one action must finish before another one called. You can do it by checking the status of ajax request of previous calls and if that was in finished state, you can call next action. This process may be resource extensive if you dont care for checking. So here is a simple actionChain object which will help to put numbers of actions in a chain (or you better say, queue) and call them one of after one smartly. I just demonstrate how it works&lt;br /&gt;&lt;br /&gt;&amp;lt;script&gt;&lt;br /&gt;var actionChain = {&lt;br /&gt;          curIndex: 0,&lt;br /&gt;          actions: new Array(),&lt;br /&gt;          fire: function()&lt;br /&gt;          {&lt;br /&gt;                    if (this.curIndex&amp;lt;this.actions.length)&lt;br /&gt;                    {&lt;br /&gt;                              alert(this.actions[this.curIndex]);&lt;br /&gt;                              this.callback();&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                    {&lt;br /&gt;                              alert("finished");&lt;br /&gt;                    }&lt;br /&gt;          },&lt;br /&gt;          increase: function()&lt;br /&gt;          {&lt;br /&gt;                    this.curIndex++;&lt;br /&gt;          },&lt;br /&gt;          addAction: function(actionName)&lt;br /&gt;          {&lt;br /&gt;                    this.actions[this.actions.length] = actionName;&lt;br /&gt;          },&lt;br /&gt;          initialize: function()&lt;br /&gt;          {&lt;br /&gt;                    this.curIndex=0;&lt;br /&gt;                    this.actions = new Array();&lt;br /&gt;          },&lt;br /&gt;          callback: function(){}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;actionChain.callback=checkVar;&lt;br /&gt;&lt;br /&gt;function checkVar()&lt;br /&gt;{&lt;br /&gt;      actionChain.increase();&lt;br /&gt;      actionChain.fire();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;for(i=1;i&lt;11;i++)&lt;br /&gt;{&lt;br /&gt;      actionChain.addAction("hello"+i);&lt;br /&gt;}&lt;br /&gt;actionChain.fire(); &lt;br /&gt;actionChain.initialize();&lt;br /&gt;for(i=1;i&lt;4;i++)&lt;br /&gt;{&lt;br /&gt;      actionChain.addAction("hello"+i);&lt;br /&gt;}&lt;br /&gt;actionChain.fire(); &amp;lt;/script&gt;&lt;this.actions.length) else="" alert="" finished="" actionname="" length="actionName;" curindex="" actions="new" array="" callback="" function="" checkvar="" increase="" initialize="" addaction="" hello="" i="1;i&lt;11;i++)" fire="" gt=""&gt;&lt;this.actions.length) else="" alert="" finished="" actionname="" length="actionName;" curindex="" actions="new" array="" callback="" function="" checkvar="" increase="" initialize="" addaction="" hello="" i="1;i&lt;11;i++)" fire="" script=""&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;so here you see, an actionChain object is created and then we add some actions. Then we call the fire() method. This fire() method simply invoke callback function with current action in queue. And the call back function just increases the counter. So when the counter reaches at final offset, it will terminate.&lt;br /&gt;&lt;br /&gt;Here I show a basic demo, just modifying it a bit you can create your full fledged ajax action chain object ( i mean a proper object which stores the action, their url, parameters and response callback etc...)&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;&lt;/this.actions.length)&gt;&lt;/this.actions.length)&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114549976056814422?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114549976056814422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114549976056814422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114549976056814422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114549976056814422'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/creating-action-queue-for-ajax-calls.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114524151877243719</id><published>2006-04-16T19:28:00.000-07:00</published><updated>2006-04-16T19:51:19.560-07:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Generic Smarty Template to make Report from SQL Query&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Smarty is  an awesome template engine for php developers. It gives you ultimate  flexibility over your template. Short learning curve, easy syntax and  performance makes it really unbetable. Yesterday night I designed a  generic smarty template which can take an array of records and display  them in a table.&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;source of autoreport.tpl&lt;/strong&gt;&lt;br /&gt;&amp;lt;table class="auto_table"&amp;gt;&lt;br /&gt;{if $headers ne ""}&lt;br /&gt;   &amp;lt;tr class="auto_header_row"&amp;gt;&lt;br /&gt;   {section name=header_offset loop=$headers}&lt;br /&gt;       &amp;lt;th class="auto_header"&amp;gt;{$headers[header_offset]}&amp;lt;/th&amp;gt;&lt;br /&gt;   {/section}&lt;br /&gt;   &amp;lt;/tr&amp;gt;&lt;br /&gt;{/if}&lt;br /&gt;{foreach item=row from=$data}&lt;br /&gt;   &amp;lt;tr class="auto_data_row"&amp;gt;&lt;br /&gt;   {section name=column_offset loop=$row}&lt;br /&gt;       &amp;lt;td class="auto_data"&amp;gt;&lt;br /&gt;       {$row[column_offset]}&lt;br /&gt;       &amp;lt;/td&amp;gt;&lt;br /&gt;   {/section}&lt;br /&gt;   &amp;lt;/tr&amp;gt;&lt;br /&gt;{/foreach}&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;So how to use that template? take a look at this code&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;// connect to your db, say mysql&lt;br /&gt;$records = array();&lt;br /&gt;$result = mysql_query("select name, roll from tablename");&lt;br /&gt;while ($row = mysql_fetch_row($result))&lt;br /&gt;{&lt;br /&gt;  $records[] = $row;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$smarty-&amp;gt;assign("data",$records);&lt;br /&gt;$smarty-&amp;gt;assign("headers",array("name","roll"));&lt;br /&gt;$smarty-&amp;gt;display("autoreport.tpl");&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Thats it!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114524151877243719?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114524151877243719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114524151877243719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114524151877243719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114524151877243719'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/generic-smarty-template-to-make-report.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114517072202015097</id><published>2006-04-15T23:57:00.000-07:00</published><updated>2006-04-16T00:02:21.266-07:00</updated><title type='text'></title><content type='html'>&lt;h1&gt;Zephyr Beta 2.0 Released &lt;/h1&gt;visit : &lt;a href="http://zephyr-php.sourceforge.net"&gt;Zephyr&lt;/a&gt;&lt;br /&gt;&lt;p&gt;After a long time since the beta 1.0, today we released the second beta versionof zephyr. It is more optimized than the previous one. This version comes with many new features but major improvements are&lt;/p&gt;1. Prototype is now a part of Zephyr&lt;br /&gt;2. SQLite support&lt;br /&gt;3. Multilevel Filters&lt;br /&gt;4. Multiple pre action processors&lt;br /&gt;5. Supports Multiple database concurrently (From same/different providers)&lt;br /&gt;6. Overall performance tuning&lt;br /&gt;7. Embeded script execution&lt;br /&gt;8. Multibyte strings are supported&lt;br /&gt;9. Package Initializers&lt;br /&gt;&lt;br /&gt;We have worked hard to make this release. We hope we can release its final version pretty soon.Download : &lt;a href="http://zephyr-php.sourceforge.net"&gt;Here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114517072202015097?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114517072202015097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114517072202015097' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114517072202015097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114517072202015097'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/zephyr-beta-2.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114455785793460210</id><published>2006-04-08T21:41:00.000-07:00</published><updated>2006-04-08T21:44:17.953-07:00</updated><title type='text'></title><content type='html'>&lt;div style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1pt; padding: 0in 0in 1pt; font-weight: bold;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;Zephyr Beta 2 : Upcoming Features&lt;/p&gt;  &lt;/div&gt;&lt;p class="MsoNormal"&gt;Yesterday night I added some great functionality in zephyr. Developers can use “Filters” in zephyr packages. In primary stage I just implemented two type of filters, one is “pre-filter” and another is “post-filter”. Pre filters are a simple object which is invoked when visitors input data. Before passing these data to actions, zephyr will call “process()” method of pre filter object. After processing them, these data will be passed to action. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Pre filters are of great use of you want to implement some sort of input filtering. Beside submitted data from users, Prefilters will also receive the action name which is responsible to handle those data. So it will remain flexible to developers. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Second type of filter that I implemented is “postfilter”. After rendering the view, this filter is invoked with the rendered content and action name. So developers can polish the rendered output if they need to. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Day by day I will also add filter in different execution level of zephyr core. I am also planning to implement JSON support in zephyr. Here is a comprehensive list of implemented features for upcoming version of zephyr beta 2.0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Multiple      Database Support (For both same provider and different provider)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;SQLite      support&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Prototype      is now a part of zephyr. So users can take advantage of this great      library. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Automatic      display of “loading” image when an action is called. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Multiple      PHP file loading capability&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Multiple      Javascript file loading capability&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Multiple      pre action processors&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Supports      exchanging non printable characters as response and request. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Easy      loading of PEAR packages. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Package      Initializer, a special object that will be invoked while loading the      package for first time. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Abstract      DBInfo class, to simplify sharing db information. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;flexible      execute() method in DAO&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Better      exception management. &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;                                           &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114455785793460210?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114455785793460210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114455785793460210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114455785793460210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114455785793460210'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/zephyr-beta-2-upcoming-features.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114446513486303868</id><published>2006-04-07T19:57:00.000-07:00</published><updated>2006-04-07T20:05:02.296-07:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Fixing Multiple Database bug in adoDB&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;popular data access layer for php, adoDB can support multiple databases from different provider at time, but not from same provider. what I mean is if you instantiate two adoDB connection like this&lt;br /&gt;&lt;br /&gt;$db1 = &amp;NewAdoConnection (“mysql”);&lt;br /&gt;$db1 = &amp;NewAdoConnection (“oracle”);&lt;br /&gt;&lt;br /&gt;then you can run queries simultaneously from these connections. but if you want to access two database from same provider like this&lt;br /&gt;&lt;br /&gt;$db1 = &amp;NewAdoConnection (“mysql”);&lt;br /&gt;$db1 = &amp;NewAdoConnection (“mysql”);&lt;br /&gt;$db1-&gt;PConnect(logininfo_for_first_database)&lt;br /&gt;$db2-&gt;PConnect(logininfo_for_second_database)&lt;br /&gt;&lt;br /&gt;then only last action will remain active and if you use $db1-&gt;execute(), it will actually works on second database. if you want to access any table from first database, it will generate an error. I think this is an internal bug in adoDB.&lt;br /&gt;&lt;br /&gt;How to fix this bug?&lt;br /&gt;&lt;br /&gt;if you open adodb-mysql.inc.php and goto function _connect() you will find this line at the end&lt;br /&gt;&lt;br /&gt;1. if ($argDatabasename) return $this-&gt;SelectDB($argDatabasename);&lt;br /&gt;&lt;br /&gt;now goto SelectDB function and see what it contains actually.&lt;br /&gt;&lt;br /&gt;// returns true or false&lt;br /&gt;function SelectDB($dbName)&lt;br /&gt;{&lt;br /&gt;$this-&gt;databaseName = $dbName;&lt;br /&gt;if ($this-&gt;_connectionID) {&lt;br /&gt;return @mysql_select_db($dbName,$this-&gt;_connectionID);&lt;br /&gt;}&lt;br /&gt;else return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;so it basically returns a boolean value, mysql connection link is stored in $this-&gt;_connectionID variable. Now modify this code like this&lt;br /&gt;&lt;br /&gt;1. add this line at the declaration section of adodb-mysql.inc.php&lt;br /&gt;&lt;br /&gt;var $__db = array();&lt;br /&gt;&lt;br /&gt;2. modify the SelectDB function like this&lt;br /&gt;&lt;br /&gt;// returns true or false&lt;br /&gt;function SelectDB($dbName)&lt;br /&gt;{&lt;br /&gt;$this-&gt;databaseName = $dbName;&lt;br /&gt;if ($this-&gt;_connectionID) {&lt;br /&gt;@mysql_select_db($dbName,$this-&gt;_connectionID);&lt;br /&gt;$this-&gt;__db[$this-&gt;_connectionID] = $dbName;&lt;br /&gt;return $this-&gt;_connectionID;&lt;br /&gt;}&lt;br /&gt;else return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;3. Now open the _query function and modify it like this&lt;br /&gt;&lt;br /&gt;// returns queryID or false&lt;br /&gt;function _query($sql,$inputarr)&lt;br /&gt;{&lt;br /&gt;//global $ADODB_COUNTRECS;&lt;br /&gt;//if($ADODB_COUNTRECS)&lt;br /&gt;$this-&gt;SelectDB($this-&gt;__db[$this-&gt;_connectionID]);&lt;br /&gt;return mysql_query($sql, $this-&gt;_connectionID);&lt;br /&gt;//else return @mysql_unbuffered_query($sql,$this-&gt;_connectionID);&lt;br /&gt;// requires PHP &gt;= 4.0.6&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;That’s it!!, now your adoDB supports multiple databases from same provider.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114446513486303868?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114446513486303868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114446513486303868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114446513486303868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114446513486303868'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/fixing-multiple-database-bug-in-adodb.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25451963.post-114440089793524395</id><published>2006-04-07T02:07:00.000-07:00</published><updated>2006-04-07T02:08:17.956-07:00</updated><title type='text'></title><content type='html'>&lt;img src="http://www.packtpub.com/images/100x123/190481140X.png" alt="Smarty Book" /&gt;&lt;strong&gt;&lt;br /&gt;Smarty PHP Template Programming and Applications In Detail&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;   Smarty is a templating engine for PHP. Designers who are used to working with HTML files can work with Smarty templates, which are HTML files with simple tags while programmers work with the underlying PHP code. The Smarty engine brings the code and templates together. The result of all this is that designers can concentrate on designing, programmers can concentrate on programming, and they don't need to get in each others way so much.&lt;br /&gt;   Even if you are developing a site on your own, Smarty is a powerful way to make your code clearer to you and others, as well as easier to debug and modify later.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What you will learn from this book&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;   This book is a comprehensive guide to all aspects of using Smarty. It will help you to:&lt;br /&gt;&lt;br /&gt;       * Install and configure Smarty on your Web server&lt;br /&gt;       * Understand how Smarty affects your web site architecture, and build site foundations that make the most of what Smarty offers&lt;br /&gt;       * Designers will learn to work with templates that contain variables and logic, to modify layouts or content of Smarty web sites&lt;br /&gt;       * See how Smarty caching can improve the performance of your sites&lt;br /&gt;       * Develop custom Smarty functions and plug-ins to incorporate into your templates&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Approach&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;   Using a step-by-step approach based on realistic examples, the expert authors show you how to use Smarty in your own PHP development.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Who this book is written for&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;   This book is written for PHP developers who want to use Smarty templates in their development, and for designers who are working with PHP developers who are using Smarty.&lt;br /&gt;&lt;br /&gt;Author(s) : &lt;a href="http://hasin.wordpress.com"&gt;Hasin Hayder&lt;/a&gt;,  Joao Prado, Lucian Gheorge&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25451963-114440089793524395?l=phpfive.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpfive.blogspot.com/feeds/114440089793524395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25451963&amp;postID=114440089793524395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114440089793524395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25451963/posts/default/114440089793524395'/><link rel='alternate' type='text/html' href='http://phpfive.blogspot.com/2006/04/smarty-php-template-programming-and.html' title=''/><author><name>PHP Nerd</name><uri>http://www.blogger.com/profile/02885425836492762246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
