Friday, 24 July 2015

Incrementing/Decrementing Operators

Note: The increment/decrement operators only affect numbers and strings. Arrays, objects and resources are not affected. Decrementing NULL values has no effect too, but incrementing them results in 1. Increment/decrement Operators ExampleNameEffect ++$aPre-incrementIncrements $a by one, then returns $a. $a++Post-incrementReturns $a, then increments $a by one. --$aPre-decrementDecrements $a by one, then returns $a. $a--Post-decrementReturns $a, then decrements $a by...

Tuesday, 21 July 2015

Delete multiple rows from mysql with checkbox

Delete multiple rows from mysql with checkbox Delete multiple rows from mysql with checkbox. Syntax "DELETE FROM table_name WHERE column_name = 'value' "; Overview In this tutorial create 1 file1. delete_multiple.php Step1. Create table"test_mysql" in database "test".2. Create file delete_multiple.php. Create table "test_mysql" CREATE TABLE `test_mysql` (`id` int(4) NOT NULL auto_increment,`name` varchar(65) NOT NULL default...

PHP Variable Interpolation

PHP supports interpolation of variables in between set of words to be printed to the browser using PHP output statements like echo(), print() and etc. There are two methods in variable interpolation. First method is to use variables in between string enclosed by double quotes which is shown as follows. $name = "PHPPOT"; echo "I am reading $name"; // output: I am reading PHPPOT Then, the variable interpolation can also be implemented with here...

PHP Data Type Conversion

In PHP, variable’s data type is taken depends on the value assigned to it. When this variable is used in some expression where there is an operand of different datatype, then, the type of this variable will automatically be converted at the time of evaluation. For example, If a variable is initialized as string, and used to perform addition with an integer, then it will be taken as integer at the time of evaluation. If we want to specify...

PHP Variable Scope

The scope of an variable is a metric about which extent the variable can be visible. There are two main categories in variable scope. These are, Local scope Global scope Local Scope: If the variable is recognized with in particular block structure of the program, then it is called as local variable. For example, if the variable declared inside a function will come under the local scope of that function. The number of arguments passed while...

PHP Globals with EGPCS Information

PHP contains so many predefined global variables which is called as super globals. These variables are started with an underscore (_) symbol, for example, $_GET, $_POST and etc. Unlike, user defined global variables, this kind of super globals can be accessed from PHP function without using global keyword or anything. Super globals used to contain array of information about form contents, sessions, cookies and also have some environment information,...

PHP Operators

Like other programming languages, PHP includes set of operators that are used to perform operations between one or more values. PHP has variety of operators based on the operations to be performed. Each operator has precedence, depends on which order an PHP expression will be executed. Sub expressions that hold operators with higher precedence, are having higher priority during execution. In this article, we are going to see about various type...

PHP Type Hinting

As PHP is a loosely typed language, there is no need to specify data type for variable declaration, function declaration or any where. But, using PHP5, we can specify data type that are passed as arguments of PHP functions. This capability is called as type hinting. Advantages of PHP Type Hinting Using PHP type hinting, we can know the expected argument type of the function at the time of maintenance. Function declaration and usage would be...

PHP Variables

Like other programming languages, PHP variables are used to store some values which can be changed or removed by any time. PHP variables can be declared by specifying the name of the variable starting with a $ sign. For example, $message = "Welcome to PHPPOT"; $count = 5; In PHP, we need not to specify the data type of a variable while declaration. Rather, the type of initialized value of that variable can be taken as the variable type. In...