
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
2K+ Views
JSON structure can be created with the below code −$json = json_encode(array( "client" => array( "build" => "1.0", "name" => "xxxx", "version" => "1.0" ), "protocolVersion" => 4, "data" => array( "distributorId" => "xxxx", "distributorPin" => "xxxx", "locale" => "en-US" ) ));

AmitDiwan
255 Views
The usort function can be used to sort a multidimensional array. It sorts with the help of a user defined function.Below is a sample code demonstration −Examplefunction compare_array($var_1, $var_2) { if ($var_1["price"] == $var_2["price"]) { return 0; } return ($var_1["price"] < $var_2["price"]) ? -1 ... Read More

AmitDiwan
953 Views
A value can be converted into a string with the help of (string) cast or the strval() function.The strval() function is a function call whereas (string) cast is an internal type casting method.Unless there is some specific dataset or use case, both of these can be used interchangeably.This is because ... Read More

AmitDiwan
271 Views
For validation in MongoDB, use validator. Following is the query to create validation on collection in MongoDB −> db.createCollection( "demo437" , { ... validator: { $jsonSchema: { ... bsonType: "object", ... required: [ "FirstName", "LastName"], ... properties: { ... ... Read More

AmitDiwan
140 Views
Let us first create a table −mysql> create table DemoTable2015 -> ( -> StudentId int, -> StudentName varchar(20), -> StudentCountryName varchar(20) -> ); Query OK, 0 rows affected (1.20 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2015 values(1, ... Read More

AmitDiwan
2K+ Views
Here, we are taking BIGINT type, since it takes 8 byte signed integer. Let us first create a table with column as BIGINT type −mysql> create table DemoTable2031 -> ( -> ByteValue bigint -> ); Query OK, 0 rows affected (1.17 sec)Insert some records in the table ... Read More

AmitDiwan
1K+ Views
To find maximum value, use MAX() along with CAST(), since the values are of VARCHAR type. Let us first create a table −mysql> create table DemoTable2030 -> ( -> Value varchar(20) -> ); Query OK, 0 rows affected (0.44 sec)Insert some records in the table using insert ... Read More

AmitDiwan
634 Views
Let us first create a table −mysql> create table DemoTable2029 -> ( -> Id int, -> FirstName varchar(20), -> LastName varchar(20) -> ); Query OK, 0 rows affected (0.98 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2029 values(1, 'Chris', 'Brown') ... Read More

AmitDiwan
681 Views
Following is the code to create a thumbnail image using CSS −Example Live Demo img { border: 3px solid rgb(208, 255, 0); border-radius: 4px; width: 150px; height: 150px; } img:hover { box-shadow: 2px 2px 4px 2px rgb(60, 255, 53); } ... Read More