Enable errors in PHP There are two ways to enable error reporting in your PHP scripts: 1. You can add the following function in the the script: error_reporting(E_ALL); 2. You can add the following option in …

Last updated 7 years, 6 months ago | 2827 views

Tags:- PHP

Mysql | Trigger The trigger can be defined as a database object just like a stored procedure. It is a set of actions that fires automatically when an event occurs in a database.   Triggers …

Last updated 7 years, 6 months ago | 2817 views

Tags:- MySQL

PHP | Sort an array of arrays by date in PHP Here a situation in which we have to sort an array of the array by date. An array of arrays is a multidimensional array in …

Last updated 7 years, 6 months ago | 2814 views

Tags:- PHP

PHP | Check data type in php | gettype() | var_dump() By using gettype() function we can check the data type of a variable. we can also use var_dump() function for the same.   gettype() <?php echo …

Last updated 7 years, 6 months ago | 2810 views

Tags:- PHP

PHP | What is difference between == and === operator? "==" and "===" The two operators are known as comparison operators. "==" (i.e. equal)  and === (i.e. identical) both are use to check values are …

Last updated 7 years, 6 months ago | 2809 views

Tags:- PHP

PHP | Find the number of rows in a result set Bellow code is use for the same $sql = "SELECT * FROM table1"; $result = mysql_query($sql, $db_link); $num_rows = mysql_num_rows($result); echo $num_rows;  

Last updated 8 years, 1 month ago | 2801 views

Tags:- PHP PHP-MySQL

PHP | Syntax, and Tags PHP introduces a list of Tags to code PHP. PHP tags allow the PHP parsing engine to get in and get out from the PHP block. A PHP script can …

Last updated 7 years, 1 month ago | 2795 views

Tags:- PHP

PHP | magic function In PHP all functions start with __ names are magical functions. Magical functions always live in a PHP class. The definition of the magical function is defined by the programmer itself. …

Last updated 7 years, 6 months ago | 2782 views

Tags:- PHP

MySQL | What is the best collation to use for MySQL? Mostly we use: utf8_general_ci utf8_unicode_ci utf8_general_ci is used for fast sorting but it is less accurate whereas utf8_unicode_ci is used for better accuracy but …

Last updated 8 years, 1 month ago | 2781 views

Tags:- MySQL

PHP | How to avoid errors in PHP? We can use PHP inbuilt function error_reporting(0) to avoid all errors in PHP file. <?php error_reporting(0); ?>  

Last updated 7 years, 6 months ago | 2781 views

Tags:- PHP

PHP |  date() function By using the PHP date() function we can find the current date and time. <?php echo date(“d-m-Y”); //This will print today date. echo date (“d-m-Y h:i:s”) // This will print today’s date …

Last updated 7 years, 6 months ago | 2764 views

Tags:- PHP

PHP | Length of a string There is a string function called strlen() which is used to find the length of a string. It accepts a string that returns the length of the given string.  …

Last updated 7 years, 6 months ago | 2764 views

Tags:- PHP

Python | Print  Triangle pyramid pattern This is an example of how to print the Triangle pyramid pattern. It takes an input number from the user to print the number of rows for the pattern.  n …

Last updated 5 years, 6 months ago | 2756 views

Tags:- Python

PHP | Increase default session  timeout The "session.gc_maxlifetime" is use to modify the default timout of session. server should keep session data for AT LEAST 1 hour by using the below code. It increase session …

Last updated 7 years, 6 months ago | 2751 views

Tags:- PHP

PHP | Statement $x = 3 + "15%" + "$25"? The correct answer is 18. Here’s why: PHP is a  loosely typed language, therefore it does automatic type conversion based on the context in which …

Last updated 7 years, 1 month ago | 2750 views

Tags:- PHP