Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by AmitDiwan
Page 638 of 839
MySQL Datetime to add days?
Let us first create a table −mysql> create table DemoTable1871 ( ArrivalDate datetime ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1871 values('2019-12-19 7:45:00'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1871 values('2018-11-10 12:00:00'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1871 values('2019-01-31'); Query OK, 1 row affected (0.00 sec)Display all records from the table using select statement −mysql> select * from DemoTable1871; This will produce the following output −+---------------------+ | ArrivalDate | ...
Read MoreGet first date from timestamp in MySQL group by another column with duplicate value
For this, you can use aggregate function MIN() and GROUP BY. Let us first create a table −mysql> create table DemoTable1870 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value int, ShippingTimestamp varchar(100) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1870(Value, ShippingTimestamp) values(10, '1570645800'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1870(Value, ShippingTimestamp) values(10, '1546194600'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1870(Value, ShippingTimestamp) values(11, '1573324200'); Query OK, 1 row affected (0.00 ...
Read MoreFormatting Text Using CSS
To format text in CSS, you can change the text color, text decoration, line height, text direction, text alignment, etc.Let us see some examples −Text AlignmentTo set text alignment using CSS, use the text-align property. Following are the possible property values −text-align: left|right|center|justify|initial|inherit;ExampleLet us see an example to set text alignment − Live Demo .demo { -webkit-columns: auto auto; /* Chrome, Safari, Opera */ -moz-columns: auto auto; /* Firefox */ columns: auto auto; text-align: justify; } Machine Learning Today’s Artificial Intelligence (AI) has far surpassed the hype of blockchain and ...
Read MoreSetting Text Color using CSS
To set the text color, use the color property in CSS. You can set the color with the color name, hexadecimal value, RGB value, or using the HSL value.Example Live Demo span { background-color: orange; color: white; } p.demo { display: none; } span.demo1 { display: inline; } Match Details Match will begin at 9AM 10AM on 20th December. Match will end at 5PM on 20th December. OutputExampleLet us now see another example − Live Demo p.demo1 { word-spacing: 1cm; color: #F8E61C; } p.demo2 { word-spacing: 40px; } Demo Heading Heading2 This is demo text. Heading2 This is demo text. Output
Read MoreGenerating Random String Using PHP
To generate random string using PHP, the code is as follows−Example Live DemoOutputThis will produce the following output−Displaying random string... 1c856ExampleLet us now see another example − Live DemoOutputThis will produce the following output−Displaying random string... a3541 Displaying another random string... 335b83d9e9
Read MoreHow to access an associative array by integer index in PHP?
To access an associative array by integer index in PHP, the code is as follows−Example Live DemoOutputThis will produce the following output−Array key and value... key: p, value: 150 key: q, value: 100 key: r, value: 120 key: s, value: 110ExampleLet us now see another example− Live DemoOutputThis will produce the following output−Array key and value... key: p, value: 150 key: q, value: 100 key: r, value: 120 key: s, value: 110 Updated Array key and value... key: p, value: 150 key: q, value: 100 key: r, value: 20 key: s, value: 10
Read MoreHow to check whether an array is empty using PHP?
To check whether an array is empty, the code is as follows in PHP−Example Live Demo
Read MoreHow to create a copy of an object in PHP?
To create a copy of an object in PHP, the code is as follows−Example Live DemoOutputThis will produce the following output−JackKevin TomRyanExampleLet us now see another example − Live DemoOutputThis will produce the following output−Demo Object( [deptname] => Finance [deptzone] => West ) Demo Object( [deptname] => Finance [deptzone] => West )
Read MoreMerge two arrays keeping original keys in PHP
To merge two arrays keeping original keys in PHP, the code is as follows−Example Live DemoOutputThis will produce the following output−array(8) { ["p"]=> string(3) "150" ["q"]=> string(3) "100" ["r"]=> string(3) "120" ["s"]=> string(3) "110" ["t"]=> string(3) "115" ["u"]=> string(3) "103" ["v"]=> string(3) "105" ["w"]=> string(3) "125" }ExampleLet us now see another example − Live DemoOutputThis will produce the following output−array(1) { ["a"]=> string(5) "Jacob" }
Read MoreWhat is the use of the @ symbol in PHP?
PHP supports the error control operator i.e. the at sign (@). When @ is prepended to an expression, any error messages that might be generated by that expression gets ignored.To use @ symbol in PHP, the code is as follows−Example Live Demo
Read More