
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
3K+ Views
The property_exists() or the isset() function can be used to check if the property exists in the class or object.SyntaxBelow is the syntax of property_exists() function−property_exists( mixed $class , string $property )Exampleif (property_exists($object, 'a_property'))Below is the syntax of isset() function−isset( mixed $var [, mixed $... ] )Exampleif (isset($object->a_property))The isset() will ... Read More

AmitDiwan
2K+ Views
To get the subdirectories present in a directory, the below lines of code can be used −Example Live DemoOutputThis will produce the following output. The glob function is used to get all the subdirectories of a specific directory−Array ( [0] => demo.csv [1] => mark.php [2] => contact.txt ... Read More

AmitDiwan
291 Views
To set NOT NULL, use IS NOT NULL and find the value. The syntax is as follows −select if('' is not NULL, 1, 0) as anyAliasName;Here is the working query −mysql> select if('' is not NULL, 1, 0);This will produce the following output −+------------------------+ | if('' is not NULL, 1, ... Read More

AmitDiwan
288 Views
For this, use SET yourColumnName = NULL as in the below syntax −update yourTableName set yourColumnName=NULL where yourColumnName=yourValue;Let us first create a table −mysql> create table DemoTable1914 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Code varchar(20) )AUTO_INCREMENT=1001; Query OK, 0 rows affected (0.00 sec)Insert some ... Read More

AmitDiwan
768 Views
The parse_url and parse_str functions can be used to get the ID of a specific YouTube video.Example Live DemoOutputVX96I7PO8YUIn the above code, the parse_url function takes in a string and slices it into an array of information. The element that the user specifically wants to work with can be specified as ... Read More

AmitDiwan
205 Views
To append 000, use the concept of ZEROFILL. Let us first create a table −mysql> create table DemoTable1913 ( Code int(4) ZEROFILL AUTO_INCREMENT NOT NULL, PRIMARY KEY(Code) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

AmitDiwan
224 Views
For this, use ORDER BY along with LIMIT. Let us first create a table wherein we have a column with User id, logged in time, and name −mysql> create table DemoTable1911 ( UserId int, UserLoggedInTime time, UserName varchar(20) ); Query OK, 0 rows affected (0.00 ... Read More

AmitDiwan
467 Views
This depends on the requirements in hand.JSON is quicker in comparison to PHP serialization unless the following conditions are met−Deeply nested arrays are stored.The objects that are stored need to be unserialized to a proper class.The interaction is between old PHP versions that don't support json_decode.The below line of code ... Read More

AmitDiwan
602 Views
For this, you can use CASE WHEN statement. Let us first create a table −mysql> create table DemoTable1910 ( FirstName varchar(20), Marks int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1910 values('Chris', 45); Query ... Read More