Arjun Thakur has Published 1176 Articles

reset() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

160 Views

The reset() function sets the internal pointer of an array to its first element. It returns the value of the first array element. It returns FALSE if the array is empty Syntax reset(arr) Parameters arr − The array to be used Return The reset() function returns ... Read More

When should I use a composite index in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

443 Views

The composite index can be used when we are using sub queries. The advantages of using composite index are in case of. Joining Filtering Selecting The following is the syntax of index. index(column_name1, column_name2, column_name3, column_name4, ............................N) Let us create a table first and within that ... Read More

What is the operator <=> in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

121 Views

Here are the usages of the operator in MySQL. Case 1 This operator is similar to = operator i.e. when the value is equal then the result will become true(1), otherwise false(0). In the first case both = and operators work same. Case 2 Whenever we compare any ... Read More

Shortcomings of mysql_real_escape_string?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

116 Views

The shortcoming of mysql_real_escape_string is as follows − It has main shortcoming in the modern API while we are making prepared statement. This has another shortcoming for every possible attack when you will typecast. Let us see the typecast syntax in MySQL − (TypeCast)mysql_real_escape_string($_REQUEST['anyColumnName'])); In the above syntax, ... Read More

Community Antenna Television

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

606 Views

Cable television in their early days were called Community Antenna Television (CATV) or sometimes as Community Access Television. It was originally conceived as a method to provide cable TV services to rural areas and hilly terrains. The subscribers who want to avail the cable TV services need to pay a ... Read More

How to list down all the running queries in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

4K+ Views

To list running queries, we need to use the ‘show processlist’ command. The following is the query. mysql> SHOW processlist; The following is the output of the above query. +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | Id | User | Host ... Read More

How can I use MySQL replace() to replace strings in multiple records?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

938 Views

The replace() function can be used to replace a string with another string. To understand replace(), we need to create a table with some records. The following is the query to create a table. mysql> create table replaceDemo -> ( -> Name varchar(200) ... Read More

Difference between MySQL BigInt(20) and Int(20)?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

3K+ Views

The int type takes 4 byte signed integer i.e. 32 bits ( 232 values can be stored). The BigInt type takes 8 byte signed integer i.e. 64 bits (264 values can be stored). Let us see an example. Creating a table with zerofill, that would add leading zeros. mysql> ... Read More

Difference between Abstract Class and Interface in C#

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

447 Views

Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the members. Abstract classes to some extent serve the same purpose, however, they are mostly used when only few ... Read More

How to escape apostrophe (') in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

3K+ Views

We can escape apostrophe (‘) in MySQL in the following two ways − We can use backslash. We can use single quotes twice (double quoted) Using backslash Let us first create a table. mysql> create table SingleQuotesDemo - > ( - > id ... Read More

Advertisements