AmitDiwan has Published 10744 Articles

jQuery not() method with Examples

AmitDiwan

AmitDiwan

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

245 Views

The not() method in jQuery is used to return elements that do not match specific criteria.SyntaxThe syntax is as follows −$(selector).not(criteria, func(index))Above, criteria are a selector expression, whereas func is the function to run for each element in the group.ExampleLet us now see an example to implement the jQuery not() ... Read More

Set a specific value for the first three column values in MySQL?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:42:15

223 Views

To set a specific value for only 1st three values, you need to use LIMIT 3. Let us first create a table −mysql> create table DemoTable1968    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records ... Read More

jQuery parentsUntil() with Example

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:40:08

251 Views

The parentsUntil() method in jQuery is used to return all ancestor elements between the selector and stop parameter value.SyntaxThe syntax is as follows −$(selector).parentsUntil(stop, filter)Above, the stop parameter is a selector expression, element or jQuery object. The filter parameter is a selector expression that narrows down the search for ancestors ... Read More

Select and insert values with preceding zeros in a MySQL table

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:37:56

144 Views

For this, you can use INSERT INTO SELECT statement along with LPAD(). Let us first create a table −mysql> create table DemoTable1967    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserId varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using ... Read More

How to use if/else condition in select in MySQL?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:36:35

1K+ Views

Let us first create a table −mysql> create table DemoTable1966    (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserName varchar(20),    PhotoLiked int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1966(UserName, PhotoLiked) values('Chris', 57); ... Read More

jQuery prop() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:35:43

605 Views

The prop() method in jQuery is used to set or return the properties and values of the selected elements.SyntaxThe syntax is as follows −$(selector).prop(property)ExampleLet us now see an example to implement the jQuery prop() method − Live Demo    $(document).ready(function(){       $("button").click(function(){       ... Read More

How to identify a column with its existence in all the tables with MySQL?

AmitDiwan

AmitDiwan

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

165 Views

To identify a column name, use INFORMATION_SCHEMA.COLUMNS in MySQL. Here’s the syntax −select table_name, column_name from INFORMATION_SCHEMA.COLUMNS where table_schema = SCHEMA() andcolumn_name='anyColumnName';Let us implement the above query in order to identify a column with its existence in all tables. Here, we are finding the existence of column EmployeeAge −mysql> select ... Read More

jQuery position() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:32:45

172 Views

The position() method in jQuery is used to return the position of the first matched element. It returns the top and left positions in pixels.SyntaxThe syntax is as follows −$(selector).position()ExampleLet us now see an example to implement the jQuery position() method − Live Demo    $(document).ready(function(){   ... Read More

Get maximum age from records with similar student names in MySQL

AmitDiwan

AmitDiwan

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

1K+ Views

For this, you can use GROUP BY along with aggregate function MAX(). Let us first create a table −mysql> create table DemoTable1964    (    StudentName varchar(20),    StudentAge int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

MySQL query to create user and grant permission

AmitDiwan

AmitDiwan

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

418 Views

To create a user and grant permission, the syntax is as follows −create database yourDatabaseName DEFAULT CHARACTER SET utf8; create user `yourUserName` identified by yourPassword; GRANT SELECT ON yourDatabaseName .* TO `yourUserName`; GRANT INSERT ON yourDatabaseName .* TO `yourUserName`; GRANT UPDATE ON yourDatabaseName .* TO `yourUserName`; GRANT DELETE ON yourDatabaseName ... Read More

Advertisements