Archive for December, 2008

Emacs for PHP


1.download php-mode.el from http://sourceforge.net/projects/php-mode/

2. copy php-mode.el to emacs/lisp/

3.byte compile php-mode.el file to get php-mode.elc file

command:  M-x byte-compile-file

4.add following lines to you .emacs file

(require ‘php-mode)

(add-to-list ‘auto-mode-alist ‘(”\\.module$” . php-mode))

(add-to-list ‘auto-mode-alist ‘(”\\.inc$” . php-mode))

(add-to-list ‘auto-mode-alist ‘(”\\.install$” . php-mode))

(add-to-list ‘auto-mode-alist ‘(”\\.engine$” . php-mode))

done! emacs is ready to support php.

try C-c C-f on built in php function

  • Share/Bookmark

Archive for December, 2008

Multiple SQL Queries in a Stored Procedure.


Working on a Thursday afternoon, I came across a problem where we had to return multiple counts (about 10 of them ) in an application. One way was to have multiple stored procedures and call them one by one, but this would mean I would have to make 10 connections to the database and 10 opens , 10 closes, phew !


So I decided to combine all of them into one:
  • Share/Bookmark