Seetha has Published 110 Answers

Execute a script when the browser starts to work offline in HTML?

seetha
Published on 14-Mar-2018 06:59:20
When the web browser starts to work offline, the onoffline attribute triggers. You can try to run the following code to implement onoffline attribute −Example<!DOCTYPE html> <html>    <body ononline = "onlineFunc()" onoffline = "offlineFunc()">       <script>          function onlineFunc() {             ... Read More

How do we add a sample computer code in HTML?

seetha
Published on 13-Mar-2018 13:51:46
Use the <samp> tag to display a sample computer code. The HTML <samp> tag is used to display the output of a computer program.ExampleYou can try to run the following code to implement <samp> tag in HTML −<!Doctype html> <html>    <head>       <title>HTML samp Tag</title>    </head> ... Read More

How do we embed custom data attributes on all HTML elements?

seetha
Published on 13-Mar-2018 12:30:06
Use the data-* attribute to embed custom data attributes. It consists of the attribute, which should not contain any uppercase letter and should get prefixed after data.Example<!DOCTYPE html> <html>    <head>       <script>          function display(rank) {             var myRank = ... Read More

Create strong text in HTML

seetha
Published on 13-Mar-2018 08:41:26
To display strong text, use the <strong> tag. The HTML <strong> tag is used for emphasizing an important text.ExampleYou can try to run the following code to implement <strong> tag in HTML −<!Doctype html> <html>    <head>       <title>HTML strong Tag</title>    </head>    <body>       ... Read More

Define a scalar measurement within a known range in HTML

seetha
Published on 13-Mar-2018 08:00:35
Use the <meter> tag to define a scalar measurement. The HTML <meter> tag specifies a scalar measurement within a known range (a gauge).ExampleYou can try to run the following code to learn how to implement <scalar> tag in HTML −<!DOCTYPE html> <html>    <head>       <title>HTML meter Tag</title> ... Read More

How can we display all the records from MySQL table with the help of PHP script that uses mysql_fetch_assoc() function?

seetha
Published on 22-Feb-2018 10:38:16
To illustrate this we are fetching all the records from a table named ‘Tutorials_tbl’ with the help of PHP script that uses mysql_fetch_assoc() function in the following example −Example<?php    $dbhost = 'localhost:3036';    $dbuser = 'root';    $dbpass = 'rootpassword';    $conn = mysql_connect($dbhost, $dbuser, $dbpass);    if(! ... Read More

Which PHP function is used to select a MySQL database?

seetha
Published on 22-Feb-2018 10:12:25
PHP uses mysql_select_db function to select a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −Syntaxbool mysql_select_db( db_name, connection );Followings are the parameters used in this function:Sr.NoParameter & Description1db_nameRequired - MySQL database name to be selected2connectionOptional - ... Read More

What happens to MySQL temporary tables if MySQL session is ended?

seetha
Published on 22-Feb-2018 09:38:08
Temporary table would be deleted if MySQL session terminates. After login again, on issuing the SELECT command we will find no data available in the database. Even our temporary table will not exist.

When a MySQL arithmetic expression returns NULL?

seetha
Published on 22-Feb-2018 07:47:13
As we know that a NULL is not a value and it is also not the same as zero. MySQL arithmetic expression returns NULL if we will use NULL in it. It can be understood with the help of the following example −Examplemysql> Select 100*NULL; +----------+ | 100*NULL | +----------+ ... Read More

How it is possible to insert a zero or an empty string into a MySQL column which is defined as NOT NULL?

seetha
Published on 22-Feb-2018 06:28:22
Declaring a column ‘NOT NULL’ means that this column would not accept NULL values but zero (0) and an empty string is itself a value. Hence there would be no issue if we want to insert zero or an empty string into a MySQL column which is defined as NOT ... Read More
Advertisements