Hi All,
Posting after a two month break sorry busy with new addition to our family my daughter(Manha). Here we go:
There is an interesting article about the experience Sitepoint developers had with twitaway application while distributing Free PDF who followed them. How they found the importance of choosing right MYSQL engine is how important :) please go through the full article for more details.
Monday, October 05, 2009
Wednesday, July 22, 2009
INSERT ON DUPLICATE KEY UPDATE and REPLACE INTO
While reading and article came across one of powerful feature REPLACE INTO,I had used INSERT ON DUPLICATE KEY UPDATE but never used REPLACE INTO.
REPLACE works in a way that if the ID column(Primary Column) doesn't have the given value it will create a new entry in the table, however, IF the value exists already then it updates the existing entry in the table.
REPLACE INTO sessions VALUES ('$id', '$data', $ts).
Read about REPLACE INTO and Difference about INSERT ON DUPLICATE KEY UPDATE vs REPLACE INTO
REPLACE works in a way that if the ID column(Primary Column) doesn't have the given value it will create a new entry in the table, however, IF the value exists already then it updates the existing entry in the table.
REPLACE INTO sessions VALUES ('$id', '$data', $ts).
Read about REPLACE INTO and Difference about INSERT ON DUPLICATE KEY UPDATE vs REPLACE INTO
Sunday, July 19, 2009
PHP: exceptions vs errors?
Was just reading twitts got the nice link about the exceptions handling the post basically explains about handling errors in PHP nice one check out the code how the fatal error are handled and customize message is displayed for user. I have not tested the code but looks ok :) . Click for post here
Wednesday, July 15, 2009
Debug message in PHP?
I am using PHP from past 4 year and used to debug my code using die and echo statement and will log the debug message in file if running backend job(Cron) while using PHP 4 and then we started using Zend Framework and use Zend_log. But for those who won't use Zend Framework here is the function which will be useful in debug debug_backtrace this function is available from PHP4 didn't know i just came to know while i was browsing php.net, This information is for user like me who didn't know about it :)
Monday, July 13, 2009
What's new in PHP V5.3?
IBM's "What's new in PHP V5.3" series covers new and exciting features in PHP V5.3.
PART 1: Changes to the object interface
PART 2: Closures and lambda functions
PART 3: Namespaces
PART 4: Creating and using Phar archives
PART 1: Changes to the object interface
PART 2: Closures and lambda functions
PART 3: Namespaces
PART 4: Creating and using Phar archives
Monday, July 06, 2009
Install PHP 5.3 on WAMP Server
Just installed PHP 5.3.0 on WAMP, Nice addon facility in WAMP now can switch between 5.2.x and 5.3.0. It was so simple that even a person with little knowledge can do it.
First install WAMP.
Then download version of php you want and install from here.
Done.
Now go to the wamp server icon in tray and switch to the version you want :)
First install WAMP.
Then download version of php you want and install from here.
Done.
Now go to the wamp server icon in tray and switch to the version you want :)
PHP Security
Good article written by Joel Reyes about PHP Security, Author has explained some of the security holes we have to take care also given link for security tool download. Go through the article worth reading.
Thursday, June 11, 2009
Keywords in the URL
Reading the post 8 Tips to Get Domain Diversity came across important tips about keywords in the url. As most of us uses tinyurl or bit.ly for making our long url to short url we forget the feature tinyurl and bit.ly provide "Optional custom name/alias" this is important for SEO.
E.g., for the page http://ansarahmed.blogspot.com/2009/06/fingerprinting-to-dynamically-enable.html, you should probably try to use bit.ly/dynamic-caching
E.g., for the page http://ansarahmed.blogspot.com/2009/06/fingerprinting-to-dynamically-enable.html, you should probably try to use bit.ly/dynamic-caching
Tuesday, June 09, 2009
Fingerprinting to dynamically enable caching/ Caching dynamic content
While reading the caching tutorial from google came across with the section about using fingerprinting concept for caching content which changes regularly. Below is the explanation from google team.
"For resources that change occasionally, you can have the browser cache the resource until it changes on the server, at which point the server tells the browser that a new version is available. You accomplish this by embedding a fingerprint of the resource in its URL (i.e. the file path). When the resource changes, so does its fingerprint, and in turn, so does its URL. As soon as the URL changes, the browser is forced to re-fetch the resource. Fingerprinting allows you to set expiry dates long into the future even for resources that change more frequently than that. Of course, this technique requires that all of the pages that reference the resource know about the fingerprinted URL, which may or may not be feasible, depending on how your pages are coded."
I am writing the code in php to implement this concept and will share with you all soon.
"For resources that change occasionally, you can have the browser cache the resource until it changes on the server, at which point the server tells the browser that a new version is available. You accomplish this by embedding a fingerprint of the resource in its URL (i.e. the file path). When the resource changes, so does its fingerprint, and in turn, so does its URL. As soon as the URL changes, the browser is forced to re-fetch the resource. Fingerprinting allows you to set expiry dates long into the future even for resources that change more frequently than that. Of course, this technique requires that all of the pages that reference the resource know about the fingerprinted URL, which may or may not be feasible, depending on how your pages are coded."
I am writing the code in php to implement this concept and will share with you all soon.
Friday, June 05, 2009
Coding Standard
While going through the post from Lukas Kahwe Smith on coding standard came across the link for coding standard of various other project and framework.
Horde Project
PEAR
Zend Framework
PHP Team
Horde Project
PEAR
Zend Framework
PHP Team
Subscribe to:
Posts (Atom)
