Category: PHP

Quick-Start Guide to ADOdb Database Abstraction Library for PHP

PHP (and yes it’s for Python too..!) Adodb library has been one of the popular database abstract library since sometime now. We have been using it since sometime for simple operations when we are not using standard framework and probably just serving the plain web-services.

Here is a quick start guide to get started with Adodb5 library when using with PHP to get started with most basic functions for database interactions. For more details one can always browser around and read through detail documentation available at http://phplens.com/lens/adodb/docs-adodb.htm. This is just a quick start guide for all those who just want it little faster to get along with.

Truncate last N lines of a file using PHP

For one of my project I needed to remove certain footer / tail-end lines from the file to make it clean as it was containing some summary of records within the file. Because if I do that it can be directly loaded into database by LOAD DATA command. To remove lines from the end of file you can use following snippet of code:

Reading MSSQL BLOG column data with PHP

I was working on a migration script to transfer data from legacy desktop software to Portal we have developed. While migrating attachments (stored as TIFF files) in BLOB (Long Binary) in Microsoft SQL Database Server using PHP it was not a cake-walk. When I observed every time it was creating a file of same size (4KB). I quickly understood that there is some limitation (of size) for reading records in PHP configuration.

Posting or Uploading Files using cURL with PHP

cURL is very important tool for PHP programmers, we tends to do so many thing with using this tool. Posting data, imitating a form post and lot more, it’s usage is countless. Some time back I came across situation where we have to post files to a 3rd party faxing service. I knew there are many possibilities but I didn’t wanted to get into sockets and file stream to get this done, just wanted to post FILE in addition to rest of the post data.

Smarty 3.0 is almost here..!

There could be some or lot of us in PHP World who might have not heard about Smarty..! Yes, Smarty is the PHP Template Engine since ages. Why Ages……? some of you might ask.. but it is there since long… really long, even before we started hearing about these PHP Frameworks.