<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘top_left_links’)->toHtml() ?>
All posts by Pramod T P
stdClass
stdClass is Generic empty class in PHP OR stdClass is universal base class in PHP.
stdClass is used to create anonymous objects with properties.
When we need to create an object without having new class. then we used stdClass class which is inbuilt in PHP.
After create object, we can add properties.
<?php
$object=new stdClass();
$object->name=’PHPCodez’;
echo $object->name;
?>
Predefined Constants
These constants are defined by the PHP core. This includes PHP, the Zend engine, and SAPI modules.
EXAMPLE
PHP_VERSION (string)
The current PHP version as a string in “major.minor.release[extra]” notation.
PHP_MAJOR_VERSION (integer)
The current PHP “major” version as an integer (e.g., int(5) from version “5.2.7-extra”). Available since PHP 5.2.7.
PHP_MINOR_VERSION (integer)
The current PHP “minor” version as an integer (e.g., int(2) from version “5.2.7-extra”). Available since PHP 5.2.7.
MySQL Access Control Lists
An ACL (Access Control List) is a list of permissions that is associated with an object. This list is the basis for MySQL server’s security model and it helps in troubleshooting problems like users not being able to connect.
MySQL keeps the ACLs (also called grant tables) cached in memory. When a user tries to authenticate or run a command, MySQL checks the authentication information and permissions against the ACLs, in a predetermined order.
MySQL SQL Functions
CONCAT(A, B) – Concatenates two string values to create a single string output. Often used to combine two or more fields into one single field.
FORMAT(X, D) – Formats the number X to D significant digits.
CURRDATE(), CURRTIME() – Returns the current date or time.
NOW() – Returns the current date and time as one value.
MONTH(), DAY(), YEAR(), WEEK(), WEEKDAY() – Extracts the given data from a date value.
HOUR(), MINUTE(), SECOND() – Extracts the given data from a time value.
DATEDIFF(A, B) – Determines the difference between two dates and it is commonly used to calculate age
SUBTIMES(A, B) – Determines the difference between two times.
FROMDAYS(INT) – Converts an integer number of days into a date value.
MySQL Nonstandard String Types
Following are Non-Standard string types:
- TINYTEXT
- TEXT
- MEDIUMTEXT
- LONGTEXT
MySQL TRIGGERS
SIX triggers are allowed in MySql table. They are as follows:
- BEFORE INSERT
- AFTER INSERT
- BEFORE UPDATE
- AFTER UPDATE
- BEFORE DELETE and
- AFTER DELETE
MySQL CREATE Objects
Following objects are created using CREATE statement:
- DATABASE
- EVENT
- FUNCTION
- INDEX
- PROCEDURE
- TABLE
- TRIGGER
- USER
- VIEW
MySQL NOW() And CURRENT_DATE()
NOW () command is used to show current year,month,date with hours,minutes and seconds.
CURRENT_DATE() shows current year,month and date only.
MySQL ISAM
ISAM is abbreviated as Indexed Sequential Access Method.It was developed by IBM to store and retrieve data on secondary storage systems like tapes.