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 10740 Articles
AmitDiwan
553 Views
For this, you need to use SET command only once. Let us first create a table −mysql> create table DemoTable1909 ( Id int NOT NULL, FirstName varchar(20), LastName varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command ... Read More
AmitDiwan
877 Views
Let us first create a table −mysql> create table DemoTable1908 ( Code text ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1908 values('MySQL(1)Database'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1908 values('MongoDB 2 ... Read More
AmitDiwan
190 Views
Let us first create a table −mysql> create table DemoTable1907 ( UserId int NOT NULL AUTO_INCREMENT, UserName varchar(20), UserAge int, UserCountryName varchar(20), PRIMARY KEY(UserId) )ENGINE=MyISAM, AUTO_INCREMENT=100; Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert ... Read More
AmitDiwan
491 Views
To change format of dates, use the DATE_FORMAT() function. Let us first create a table −mysql> create table DemoTable1906 ( DueTime datetime ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1906 values(now()); Query OK, 1 row ... Read More
AmitDiwan
409 Views
To fasten the process, you can use INDEX. Let us first create a table −mysql> create table DemoTable1905 ( FirstName varchar(20), LastName varchar(20) , INDEX F_L_Name(FirstName, LastName) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert ... Read More
AmitDiwan
425 Views
To escape backslashes, use PreparedStatement while inserting records. Let us first create a table −mysql> create table DemoTable1904 ( ClientId int, ClientName varchar(20), ClientAge int ); Query OK, 0 rows affected (0.00 sec)The Java code is as follows −import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; public ... Read More
AmitDiwan
311 Views
Let us first create a table −mysql> create table DemoTable1903 ( FirstName varchar(20), LastName varchar(20) , Age int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1903 values('John', 'Smith', 23); Query OK, 1 row ... Read More
AmitDiwan
100 Views
For text transformation in CSS, use the text-transform property with the following values −text-transform: none|capitalize|uppercase|lowercase|initial|inherit;Example Live Demo div { line-height: 1.9; text-transform: uppercase; } Demo Heading This is demo text. This is another demo text. OutputExampleLet us see another ... Read More
AmitDiwan
402 Views
To strip all spaces out of a string in PHP, the code is as follows−Example Live DemoOutputThis will produce the following output−ThisisateststrinTo remove the whitespaces only, the below code can be used−Example Live DemoOutputThis will produce the following output. The str_replace function replaces the given input string with a specific character or ... Read More
AmitDiwan
194 Views
Yes, it is possible to combine filter_input() with AND/OR in PHP. This can be done by looping over the POST fields−$value = filter_input(INPUT_POST, 'field', FILTER_DEFAULT, is_array($_POST['field']) ? FILTER_REQUIRE_ARRAY : NULL);An equivalent for the same user for each loop has been shown below−$memory = array(); //looping through all posted values foreach($_POST ... Read More