Srinivas Gorla has Published 75 Articles

How can I get a stack trace for a JavaScript exception?

Srinivas Gorla

Srinivas Gorla

Updated on 23-Jun-2020 05:12:18

329 Views

To get a JavaScript stack trace, simply add the following in your code. It will display the stack trace −Example Live Demo                    function stackTrace() {             var err = new Error();             return err.stack;          }          console.log(stackTrace());          document.write(stackTrace());                     Stacktrace prints above.     Output

How can we handle NULL values stored in a MySQL table by using PHP script?

Srinivas Gorla

Srinivas Gorla

Updated on 22-Jun-2020 14:09:52

267 Views

We can use the if...else condition in PHP script to prepare a query based on the NULL value. To illustrate it we are having the following example −ExampleIn this example, we are using the table named ‘tcount_tbl’ having the following data −mysql> SELECT * from tcount_tbl; +-----------------+----------------+ | tutorial_author | tutorial_count | ... Read More

Which PHP function is used to insert data into an existing MySQL table?

Srinivas Gorla

Srinivas Gorla

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

72 Views

PHP uses a mysql_query function to insert data into 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, connection );Followings are the parameters used in this function −S. No.Parameter & Description1.SqlRequired - SQL query ... Read More

How can I change the name of an existing column from a MySQL table?

Srinivas Gorla

Srinivas Gorla

Updated on 22-Jun-2020 13:01:19

142 Views

We can change the name of a particular existing column from a MySQL table by using CHANGE statement along with ALTER statement. Its syntax would be as follows −SyntaxALTER TABLE table_name CHANGE old_column_name new_column_name datatype;Here,  table_name is the name of the table from which we want to delete the column.Old_column_name ... Read More

How Can MySQL GROUP BY clause behave like DISTINCT clause?

Srinivas Gorla

Srinivas Gorla

Updated on 22-Jun-2020 12:05:00

393 Views

When we use the GROUP BY clause in the SELECT statement without using aggregate functions then it would behave like the DISTINCT clause. For example, we have the following table −mysql> Select * from testing; +------+---------+---------+ | id   | fname   | Lname   | +------+---------+---------+ |  200 | ... Read More

In MySQL, how we can get the total value by category in one output row?

Srinivas Gorla

Srinivas Gorla

Updated on 22-Jun-2020 11:13:35

64 Views

With the help of the MySQL SUM() function, we can get the total value by category in one output row. For example in table ‘ratelist’ if we want to get the total value of category ‘price’ then we can use SUM() on price as follows −mysql> select SUM(price) as totalprice ... Read More

How can we write MySQL handler in a stored procedure?

Srinivas Gorla

Srinivas Gorla

Updated on 22-Jun-2020 06:29:16

249 Views

Whenever an exception occurred in MySQL stored procedure, it is very important to handle it by throwing a proper error message. Suppose, 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 a handler to ... Read More

Rotate div with Matrix transforms using CSS

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 14:22:10

194 Views

You can try to run the following code to rotate div with matrix transforms using CSS:ExampleLive Demo                    div {             width: 300px;             height: 100px;           ... Read More

CSS word-wrap property

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 13:37:17

146 Views

The word-wrap property is used to break the line and wrap onto next line.ExampleThe following shows sample syntax −Live Demo                    div {             width: 200px;             border: 2px solid #000000;          }          div.b {             word-wrap: break-word;          }                     word-wrap: break-word property       ThisisdemotextThisisdemotext:       thisisaveryveryveryveryveryverylongword. The long word wraps to       the next line.     Output

What is the significant difference between MySQL TRUNCATE() and ROUND() function?

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 13:11:16

3K+ Views

The TRUNCATE() function is used to return the value of X truncated to D number of decimal places. If D is 0, then the decimal point is removed. If D is negative, then D number of values in the integer part of the value is truncated. Consider the following example ... Read More

Advertisements