Monday, May 30, 2011

difference between $ and $$ php or static and dynamic variable

<?php
//difference between $ and $$ php or static and dynamic variable
$message = 'name';
$name = 'afroz';
echo '$message='.$message;//outputs - $message=name
echo '$$message='.$$message;//outputs - '$$message=afroz
?>

Tuesday, May 24, 2011

Difference between '=', "==" and '===' in PHP

=        sign is an assignment - take what's on the right as an expression and save it in the variable named on the left.

==        sign is a comparison and tests whether the variable / expression / constant to the left has the same value as the variable / expression / constant to the right.

===        sign is a comparison to see whether two variables / expresions / constants are equal AND have the same type - i.e. both are strings or both are integers.

Friday, April 1, 2011

Difference between myisam and innodb mysql engines

1) InnoDB storage engine of MySQL has support for transactions and automatic crash recovery while MyIsam don't.

2)Innodb has transaction support, commits and rollbacks, myisam don't.
3)MyIsam has full-text indexing, InnoDB doesn't.

4)InnoDB supports foreign key constraints.