Piggybacking

Piggybacking on Internet access is the practice of establishing a wireless Internet connection by using another subscriber’s wireless Internet access service without the subscriber’s explicit permission or knowledge. It is a legally and ethically controversial practice, with laws that vary by jurisdiction around the world. While completely outlawed or regulated in some places, it is permitted in others.

A customer of a business providing hotspot service, such as a hotel or café, is generally not considered to be piggybacking, though non-customers or those outside the premises who are simply in reach may be. Many such locations provide wireless Internet access as a free or paid-for courtesy to their patrons or simply to draw people to the area. Others near the premises may be able to gain access.

The process of sending data along with the acknowledgment is called piggybacking. Piggybacking is distinct from wardriving, which involves only the logging or mapping of the existence of access points.

Heredoc

Heredoc is a robust way to create string in PHP with more lines but without using quotations. Heredoc is rarely used as the day by day usage is more complicated as creating strings with quotes or double quotes. Besides this the not properly used heredoc can lead to problems in your code.

• Delimits strings without using quotes (so no need to escape)
• Start with <<< and an identifier; end with same identifier
• Do not indent ending identifier or add any chars

Example

<?php
 $str = <<<DEMO
 phpcode
 DEMO;
 print $str;
 ?>

Output

phpcode

Switch Statement

We can use the switch statement to select one of many blocks of code to be executed.

General Format

switch (val)
{
case label1:
code to be executed if n=label1;
break;
case label2:

 code to be executed if n=label2;

 break;
default:
code to be executed if n is different from both label1 and label2;
}

Example

<?php
$val=1;
switch($val){
case 1 : echo “Sunday”;break;
case 2 : echo “Monday”;break;
case 3 : echo “Tuesady”;break;
case 4 : echo “Wednesady”;break;
case 5 : echo “Thursday”;break;
case 6 : echo “Friday”;break;
case 7 : echo “Saturday”;break;
default : echo “Sunday”;break;

}
?>

Output

Sunday

RDBMS

Short for relational database management system and pronounced as separate letters, a type of database management system (DBMS) that stores data in the form of related tables. Relational databases are powerful because they require few assumptions about how data is related or how it will be extracted from the database. As a result, the same database can be viewed in many different ways.
An important feature of relational systems is that a single database can be spread across several tables. This differs from flat-file databases, in which each database is self-contained in a single table.
Almost all full-scale database systems are RDBMS’s. Small database systems, however, use other designs that provide less flexibility in posing queries.

DBMS

A database management system (DBMS) is a software package with computer programs that control the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications by database administrators (DBAs) and other specialists. A database is an integrated collection of data records, files, and other objects. A DBMS allows different user application programs to concurrently access the same database. DBMSs may use a variety of database models, such as the relational model or object model, to conveniently describe and support applications.

It typically supports query languages, which are in fact high-level programming languages, dedicated database languages that considerably simplify writing database application programs. Database languages also simplify the database organization as well as retrieving and presenting information from it. A DBMS provides facilities for controlling data access, enforcing data integrity, managing concurrency control, and recovering the database after failures and restoring it from backup files, as well as maintaining database security.

Database

A database is an organized collection of data, today typically in digital form. The data are typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports processes requiring this information (for example, finding a hotel with vacancies).

The term database is correctly applied to the data and their supporting data structures, and not to the database management system (DBMS). The database data collection with DBMS is called a database system.

Well known DBMSs include Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL, and SQLite. A database is not generally portable across different DBMS, but different DBMSs can inter-operate to some degree by using standards like SQL and ODBC together to support a single application.

operators

= Assignment
+ Addition
Subtraction
* Multiplication
/ Division
% Modulus
== Equal To
!= Not Equal To
< Less Than
> Greater Than
<= Less Than or Equal To
>= Greater Than or Equal To
+= Plus Equals
-= Minus Equals
*= Multiply Equals
/= Divide Equals
%= Modulo Equals
.= Concatenate Equals

mysql_connect() vs mysql_pconnect()

Difference between mysql_connect() and mysql_pconnect() PHP

mysql_pconnect() acts very much like mysql_connect() with two major differences.

When connecting using mysql_pconnect() , the function would first try to find a (persistent) link that’s already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.

When connecting using mysql_connect(), the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use

Note :mysql_close() will not close links established by mysql_pconnect().

Difference between mysql_connect() and mysql_pconnect() PHP

Difference between mysql_connect() and mysql_pconnect() PHP

mysql_pconnect() acts very much like mysql_connect() with two major differences.

When connecting using mysql_pconnect() , the function would first try to find a (persistent) link that’s already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.

When connecting using mysql_connect(), the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use

Note :mysql_close() will not close links established by mysql_pconnect().