MySQL Case Sensitivity

Is MySQL Case-Sensitive?
The SQL syntax is NOT case-sensitive in MySQL.

If the application written in PHP/Perl or other languages were to be used in Microsoft & Linux environment, then it would really be an issue for the database administrators and for the programmers.

That is the reason why you might have noticed books or sites saying that it is always recommended to treat MySQL syntax as being case-sensitive.

It was interesting to learn that the database name remains case sensitive.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Simple ways to Disable Context Menu in Browser

How to disable context menu and hence disable Browser Back button?

In programmers life, there comes a situation where he/she had to disable the browser back button functionality or the back button feature on the context menu (the menu that appears when users right click on the browser content).

A simple way to disable Context Menu in browsers will be to use javascript as follows …

<html>
<head><title>How to disable content menu Back button?</title></head>
<body onContextMenu="javascript: return false;" >
<h1>Sample Text</h1>
<span style="font-size: 1.5em;">Check the CSS of this styling in the source file</span>
</body>
</html>

CSS related hint: I have used font size of 1.5em to emphasize on how “em” (the “M” space) can be used to increase the font size of the texts relatively.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

SELinux: AVC Denial phpmyadmin does not work

SELinux: AVC Denial. SELinux is preventing httpd from using potentially mislabelled files (var/www/html/phpmyadmin)

And in the browswer window you get the error “Forbidden” when you go to http://localhost/phpmyadmin

>> setenforce 0 (execute this command to check if SELinux is the culprit)

Then check if phpmyadmin works in the browser.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Peek-a-boo Bug in IE6

Peek-a-boo Bug in IE6 and the possible solutions

When we design a liquid layout, the more common case of this bug appearing in pages will be when you design a <div> layer next to another <div> layer each set to float. It occurs in IE6 and is taken care of in IE7. Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

CentOS – Command to find the version

How to find the version of CentOS running in your machine?

The following commands can be executed to find the version of CentOS running in your machine.

Command 1:
# cat /etc/issue

Command 2:
# cat /etc/redhat-release

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

MySQL – What is Character set and Collation?

As given by MySQL documentation (http://dev.mysql.com/doc/refman/4.1/en/charset-general.html): A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters in a character set.

Why is MySQL Collation an important consideration?
Collation determines the rules in comparing characters including the case sensitiveness, accent sensitiveness, trailing space sensitiveness of the character set. Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

PHP: final Methods, final Class

final Methods:

When you want an inheriting class NOT to define the method from its parent class, you will use the final Method.

class parentClass{
function methodA(){
echo “a”;
}
final function methodB(){
echo “b”;
}
}
// Following produces an error as it is trying to define a final method from its parent class
class childClass extends parentClass{
function methodB(){
echo “bbb”;
}
}

final Class:
When you do not want a class to be inherited, then you declare the class to be a final class.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

PHP5 – Being Static

Class properties

This is another name for properties (or methods) declared static inside classes as these properties belong to a class and not to any instance/object.

The keyword ‘static’ is used to define static properties. Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

PHP4 Vs. PHP5 – What is New in PHP5? – Part 1

In PHP5, Zend engine has been rewritten to accomodate the new object oriented concepts. To start with, I will write on some functions that have been added to PHP5’s bag.

~ The access modifiers public/private/protected are introduced for methods and properties.

~ __construct() is used now instead of the function names in the name of the classes which makes it a uniform way of access

~ __destruct() function is now introduced which will run when an object is destroyed

Let us create a class to verify how the above concepts work.

class myBook{
 private var $bookTitle;
 function __constructor(){
     echo "Book object created in constructor";
  }
  function getBookTitle(){
      return $this->bookTitle;
   }
   function setBookTitle(){
      $this->bookTitle = "Hope Wins";
   }
   function __destruct(){
      echo "Object perishes now!";
   }
}
$myNewBook = new myBook();
// $myNewBook->bookTitle = "Truth about life"; 
// The above statement will return an error notice as the variable bookTitle declare private.
$myNewBook->getBookTitle();
$myNewBook = nothing;
unset($myNewBook);

~ Introduction of Abstract classes
An abstract class is a class that cannot be instantiated. But, you can inherit from an abstract class. If you want to declare a method as an abstract method, then you need to declare the class as an abstract class as well. When a method is declared abstract, then the inherting class will implement the method.

abstract class shape{

var $a, $b;

function calcSqFeet($a=0, $b=0){

if(!empty($a) && !empty($b){ echo "Square feet ".$a * $b); }

}

abstract function color();
}

class rectangle extends shape{
var $a, $b;

function __construct($a, $b){
$this->a = $a;
$this->b = $b;
}

function color(){
echo "Color of the shape is :" . "Red";
}

function getSqFeet($a, $b){
return calcSqFeet($a, $b);
}

}

// Declaration
$myShape->color();
$myShape->getSqFeet(3, 4);
Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

PHP: How to print a name of a class?

The following code helps identifying the name of the class with the usage of PHP constant __CLASS__

class myClass{

    function __construct(){
        echo "You are now inside class = ".__CLASS__;
    }

}
Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Kurinchi Calendar
April 2018
M T W T F S S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
30