Nikitha N has Published 77 Articles

How to write a JavaScript RegExp to match an expression?

Nikitha N

Nikitha N

Updated on 23-Jun-2020 07:41:44

69 Views

To match an expression, use the JavaScript match() method. This method is used to retrieve the matches when matching a string against a regular expression. The following is the parameter −param − A regular expression object.If the regular expression does not include the g flag, it returns the same result ... Read More

Which is the JavaScript RegExp to find any alternative text?

Nikitha N

Nikitha N

Updated on 23-Jun-2020 07:32:05

150 Views

To match any of the specified alternatives, follow the below-given pattern −(foo|bar|baz)ExampleYou can try to run the following code to find any alternative text −           JavaScript Regular Expression                        var myStr = "one, one, ... Read More

How to write JavaScript Regular Expression for multiple matches?

Nikitha N

Nikitha N

Updated on 23-Jun-2020 05:37:40

101 Views

To find multiple matches, write a JavaScript regular expression. You can try to run the following code to implement regular expression for multiple matches −Example                    var url = 'https://www.example.com/new.html?ui=7&demo=one&demo=two&demo=three four',          a = document.createElement('a');       ... Read More

How to define a JavaScript function using Function() Constructor?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 14:42:23

100 Views

The Function() constructor expects any number of string arguments. The last argument is the body of the function - it can contain arbitrary JavaScript statements, separated from each other by semicolons.ExampleYou can try to run the following code to invoke a function with new Function Constructor −       ... Read More

Which PHP function is used to give the number of rows affected by MySQL query?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 14:08:04

151 Views

PHP uses mysql_affected_rows( ) function to find out how many rows a query changed. This function basically returns the number of affected rows in the previous SELECT, INSERT, UPDATE, REPLACE, or DELETE query. Return of an integer > 0 indicates the number of rows affected, 0 indicates that no records were ... Read More

Which PHP functions are used in the PHP script to fetch data from an existing MySQL table?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 13:55:09

81 Views

PHP uses following functions to fetch data from an existing MySQL table −mysql_query() functionThis function is used in PHP script to fetch data from an existing MySQL table. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −Syntaxbool mysql_query( sql, ... Read More

How Can we use MySQL DISTINCT clause with WHERE and LIMIT clause?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 12:17:19

5K+ Views

By using the WHERE clause with a DISTINCT clause in MySQL queries, we are putting a condition on the basis of which MySQL returns the unique rows of the result set. By using the LIMIT clause with a DISTINCT clause in MySQL queries, we are actually providing a perimeter to ... Read More

What would be the effect on summary output when I use explicit sort order (ASC or DESC) with column names in the GROUP BY list along with “WITH ROLLUP” modifier?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 11:11:10

71 Views

In the case, where we use explicit sort order (ASC or DESC) with column names in the GROUP BY list along with the “WITH ROLLUP” modifier, the summary rows added by ROLLUP still appear after the rows from which they calculated regardless of the sort order.As we know that the ... Read More

How can we see only the list of stored functions in a particular MySQL database?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 07:59:19

58 Views

We can see only the list of stored functions in a particular MySQL database by the following query −mysql> SELECT ROUTINE_TYPE, ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'query' AND ROUTINE_TYPE = 'FUNCTION'// +--------------+--------------------+ | ROUTINE_TYPE | ROUTINE_NAME       | +--------------+--------------------+ | FUNCTION     | factorial     ... Read More

How can we write MySQL handler, in a stored procedure, that throws an error message and exit the execution?

Nikitha N

Nikitha N

Updated on 22-Jun-2020 06:45:04

398 Views

As we know that whenever an exception occurred in MySQL stored procedure, it is very important to handle it by throwing proper error message because if we do not handle the exception, there would be a chance to fail application with that certain exception in a stored procedure. MySQL provides ... Read More

Advertisements