August 07, 2009

What is difference between TRUNCATE & DELETE in Mysql?

TRUNCATE is a DDL command and cannot be rolled back. All of the memory space is released back to the server.
DELETE is a DML command and can be rolled back.

Both commands accomplish identical tasks (removing all data from a table), but TRUNCATE is much faster.

TRUNCATE : You can't use WHERE clause
DELETE : You can use WHERE clause

July 18, 2009

Total number of php built-in functions

Hi all, you know that the total number of php built-in functions available is 1263

get_defined_functions() will return the built-in function list in php

To view those function list just execute the following code and have a look on yours

<?php

$functions_list = get_defined_functions();

$i = 1;
foreach($functions_list['internal'] as $function_name) {
echo $i . “. ” . $function_name . “<br/>”;
$i++;
}

?>

June 22, 2009

Unable to find the socket transport “ssl” - did you forget to enable it when you configured PHP?

Last week while implementing google docs API i got this error "Unable to find the socket transport “ssl” - did you forget to enable it when you configured PHP?". I searched for the solution and fixed at last.

Here is the solution to the above problem,

uncommented the line in php.ini
;extension=php_openssl.dll

Other related blog post

http://www.boringguys.com/2007/07/20/unable-to-find-the-socket-transport-ssl-did-you-forget-to-enable-it-when-you-configured-php/

"Ran into this error recently… here’s how to fix it, you have to install OpenSSL on your system. For OpenSSL your PHP config values look like this:

–with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)

So, if you’ve compiled from scratch, you can just recompile adding this flag to your configure command."

May 21, 2009

Jcrop plugin for image crop in jQuery

Jcrop is a cross-browser jQuery image crop plugin, a quick and easy way to add image cropping functionality to your web application. It combines the ease-of-use of a typical jQuery plugin with a powerful cross-platform DHTML cropping engine..







Some features of Jcrop:

* Attaches simply to any image in your HTML page
* Supports aspect ratio locking
* Callbacks for selection done, or while moving
* Keyboard support for nudging selection
* Support for CSS styling
* Advanced API including animation support

An example of this plugin here & a sample PHP code to complete the server-side of the crop here.

Requirements: jQuery
Compatibility: All Major Browsers
Website: http://deepliquid.com/content/Jcrop.html
Demo: http://deepliquid.com/content/Jcrop_Examples.html

May 15, 2009

Solved problem with setAttribute () in javascript

This week i faced a problem with setAttribute() in javascript, i used this to set a border for an <li> tag when the particular image is clicked.
i used like this,

var LiObj = document.getElementById('img_1');
LiObj.setAttribute("style", "border: 2px solid red;");

this one perfectly works in Mozilla Firefox (since the setAttribute works fine in FF). Same opposite in IE, IE does not support setAttribute(). At this stage what i will do?

i modified the above code like this,

var LiObj = document.getElementById('img_1');
LiObj.style.border = '2px solid red';

This is an simple issue when we look at outside, when there is an deadline on any project this small design issue can trouble your head to lose the hair.

try like this tweaks to fix the browser compatible.

May 08, 2009

Brendan Eich Father of Javascript


Brendan Eich (born 1961) is a computer programmer and creator of the JavaScript programming language. He is the Chief Technology Officer at the Mozilla Corporation.