See All Foreign Keys to a Table Column

Ankith Reddy
Updated on 24-Jun-2020 14:01:05

2K+ Views

To see all the foreign keys to a table or column, the referenced_column_name command is used.First, two tables are created and then related with the help of the foreign key constraint.Creating the first table −mysql> CREATE table ForeignTable -> ( -> id int, -> name varchar(200), -> Fk_pk int -> ); Query OK, 0 rows affected (0.43 sec)After creating the first table successfully, the second table is created as follows −mysql> CREATE table primaryTable1 -> ( -> Fk_pk int, -> DeptName varchar(200), -> Primary key(Fk_pk) -> ); Query OK, 0 rows affected (0.48 sec)Now, both the tables are related with ... Read More

Interact with Local Client Files in HTML5

varun
Updated on 24-Jun-2020 14:00:39

355 Views

HTML5 allows us to interact with local client files (local client files are the files that are locally stored in the user’s computer). This is possible because HTML5 provides powerful APIs (Application Programming Interfaces) which are the interfaces with the help of which binary data and user’s local file system can be accessed. With the help of these file APIs, web applications can read files, file directory, can drag and drop from desktop to browser.The following are the APIs that are used to access local client files −File System APIFile APIFile Writer APIThe following are some examples −With the help ... Read More

Update Column Value by Replacing Part of a String in MySQL

Chandu yadav
Updated on 24-Jun-2020 13:59:31

1K+ Views

To update a column value, the update command as well as the replace method can be used. The steps to better understand these are given as follows −First create a table with the help of the create command. This is given as follows −mysql> CREATE table DemoOnReplace -> ( -> Id int, -> Name varchar(200) -> ); Query OK, 0 rows affected (0.63 sec)After successfully creating a table, some records are inserted with the help of the insert command. This is shown below −mysql> INSERT into DemoOnReplace values(1, 'John'); Query OK, 1 row affected (0.10 sec) mysql> INSERT into ... Read More

Add Video to Site Background in HTML5

Chandu yadav
Updated on 24-Jun-2020 13:58:52

449 Views

Add a button to play or pause the video. Then we have styled the video to a hundred percentage height and width so that it covers the entire background.The following is the code snippet to set video as a site background in HTML5.        Your browser does not support HTML5 video. The following is to pause the video −function display() {    if (video.paused) {       video.play();       btn.innerHTML = "Pause the video!";    } else {       video.pause();       btn.innerHTML = "Play";    } }

Change Max Allowed Packet Size in MySQL

George John
Updated on 24-Jun-2020 13:58:44

2K+ Views

The max_allowed_packet size is a session variable and is also a read only variable.To check what is the present value of max_allowed_packet, the command show variables is used. It is given as follows −mysql> show variables like 'max_allowed_packet';The following is the output+--------------------+---------+ | Variable_name | Value | +--------------------+---------+ | max_allowed_packet | 4194304 | +--------------------+---------+ 1 row in set (0.04 sec)The value of the max_allowed_packet can be changed in the ‘my.ini’ file on the client side. The query for that is given as follows −max_allowed_packet = 4567890; Now, the value can be changed globally ... Read More

What is WHERE 1=1 Statement in MySQL

Ankith Reddy
Updated on 24-Jun-2020 13:58:15

2K+ Views

In MySQL “Where 1=1” results in all the rows of a table as this statement is always true. An example to better unerstand this statement is given as follows −First, a table is created with the help of the create command. This is given as follows −mysql> CREATE table WhereConditon -> ( -> id int, -> name varchar(100) -> ); Query OK, 0 rows affected (0.43 sec)After successfully creating a table, some records are inserted with the help of insert command The query for this is given as follows −mysql> INSERT into WhereConditon values(1, 'John'); Query OK, 1 row affected ... Read More

Replace Default Meta Tag with Custom Meta Tags in HTML

usharani
Updated on 24-Jun-2020 13:57:50

247 Views

Meta tags are used to store data about HTML documents such as who wrote it and the description of the document.The best solution is to define default tags in the application and overwrite default parameters in view. We can do so in PHP.Making changes in config file first −

Save DIV as Image with HTML5 Canvas

Samual Sam
Updated on 24-Jun-2020 13:57:04

6K+ Views

DIV content can be saved as an image with the help of html2canvas() function in JavaScript. DIV tag defines a section in HTML document.Example      Welcome This shows the division area named cpimg.The html2canvas() function save div as an image with the following code −html2canvas(document.querySelector(“#cpimg”)).then(canvas  {         document.body.appendChild(canvas)  });It saves the referred div section “cpimg” into the image.

MySQL Error: Hash1046 - No Database Selected

Arjun Thakur
Updated on 24-Jun-2020 13:56:06

22K+ Views

The error-#1046 can occur when we are creating a table, but forget to select the database. Let us say we have started MySQL as shown below −After giving the correct password, the above window will open. Now create a table without choosing any database. This will show an error −mysql> CREATE table TblUni -> ( -> id int, -> Name varchar(100) -> );ERROR 1046 (3D000): No database selectedThe following screenshot is showing the same error −Now, choose any database to get rid of the above error. Firstly, let us check how many databases are present in MySQL with the help ... Read More

Save Canvas Data to File in HTML5

George John
Updated on 24-Jun-2020 13:55:49

2K+ Views

A Canvas is just a rectangular area on the HTML page. We can draw graphics in this rectangular area (Canvas) with the help of JavaScript. Canvas can be created in HTML5 as −                                 This creates an empty canvas with name canvas1 with width=200 and height=100. To draw graphics in it, we use JavaScript −var canvas = document.getElementById("Canvas1");  var ctx1 = canvas.getContext("2d"); ctx1.moveTo(0, 0); ctx1.lineTo(300, 200);  ctx1.stroke(); // This method actually draw graphics as per context object             To save this graphic, we need ... Read More

Advertisements