AmitDiwan has Published 10744 Articles

jQuery replaceWith() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:28:55

269 Views

The replaceWith() method in jQuery is used to replace selected elements with new content.SyntaxThe syntax is as follows −$(selector).replaceWith(content, function(index))Above, the content parameter is the content to insert, whereas function is to return the content to replace.ExampleLet us now see an example to implement the jQuery replaceWith() method − Live Demo ... Read More

MySQL query to separate and select string values (with hyphen) from one column to different columns

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:25:49

500 Views

For this, you can use SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable1962    (    EmployeeInformation text    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1962 values('101-John-29'); Query OK, 1 row affected (0.00 sec) ... Read More

jQuery Effect fadeOut() Method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:24:54

240 Views

The fadeout() method in jQuery is used to give a fading effect by changing the opacity for the selected elements. The fading effect changes from visible to hidden.SyntaxThe syntax is as follows −$(selector).fadeOut(speed, easing, callback)Above, the parameter speed is the speed of the fading effect. Here, easing is the speed ... Read More

Parse a string to get a number from a large string separated by underscore

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:22:24

123 Views

Let us first create a table −mysql> create table DemoTable1961    (    Title text    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1961 values('You_can_remove_the_string_part_only-10001-But_You_can_not_remove_the_numeric_parts'); Query OK, 1 row affected (0.00 sec)Display all records from the table using ... Read More

jQuery hide() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:21:27

300 Views

The hide() method in jQuery is used to hide selected elements.SyntaxThe syntax is as follows −$(selector).hide(speed, easing, callback)Above, the parameter speed is the speed of the hide effect, whereas easing is the speed of the element in different points of the animation. The callback function is a function that executes ... Read More

A single MySQL query to combine strings from many rows into a single row and display the corresponding User Id sum in another column?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:19:50

347 Views

For this, you can use GROUP_CONCAT(). Use SUM() to add the User Id. Let us first create a table −mysql> create table DemoTable1960    (    StudentId int,    StudentName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert ... Read More

Create a dynamic table name from current year in MySQL like 2019

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:18:24

1K+ Views

To create a table name like year (2019), use PREPARE statement. Let us first create a table −mysql> create table DemoTable1959    (    UserName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1959 values('Chris'); Query OK, ... Read More

jQuery delay() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:17:29

408 Views

The delay() method in jQuery is used to set a delay to delay the execution of the next item in the queue.SyntaxThe syntax is as follows −$(selector).delay(speed, queue)Above, the parameter speed is the speed of delay, whereas the queue is the name of the queue.Let us now see an example ... Read More

Display auto increment user id sequence number to begin from 001 in MySQL?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:14:27

725 Views

For this, use ZEROFILL and alter the table to begin from the same sequence −alter table yourTableName    change yourColumnName yourColumnName int(3) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT PRIMARY KEY;To understand the above syntax, let us first create a table −mysql> create table DemoTable1958    (    UserId int,    UserName ... Read More

Divide a column to get monthly salary of employees in a MySQL Query?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:11:39

393 Views

Let us first create a table −mysql> create table DemoTable1957    (    EmployeeId int,    EmployeeName varchar(20),    EmployeeSalary int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1957 values(1, 'Chris', 240000); Query OK, 1 row affected ... Read More

Advertisements