
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6705 Articles for Database

290 Views
As we know that views are a type of virtual tables and are the composition of tables too hence we can use the same query to list all the columns of a MySQL view as we can list the columns of a MySQL table. In other words, we can use SHOW FULL COLUMNS statement to get the structure of a MySQL view. Its syntax would be as follows −SyntaxSHOW FULL COLUMNS FROM View_name;Here view_name is the name of the view from which we want to get the list of columns.ExampleSuppose if we want to get a list of columns of ... Read More

467 Views
As we know that views are a type of virtual tables and are the composition of tables too hence we can use the same query to get the definition of a view which we use to get the definition of a table. In other words, we can use SHOW CREATE statement to get the definition of a MySQL view. Its syntax would be as follows −SyntaxSHOW CREATE VIEW view_name;Here view_name is the name of the view of which we want to get the definition.ExampleThe following query will give the definition of a view named ‘info’ −mysql> Show Create View Info\G ... Read More

732 Views
The function mysql_fetch_array() will return an array with the numeric index if we use the constant MYSQL_NUM as the second argument to it. To illustrate it we are having the following example −ExampleIn this example, we are fetching all the records from a table named ‘Tutorials_tbl’ with the help of PHP script that uses mysql_fetch_array() function using MYSQL_NUM as the second argument in the following example −

446 Views
As we know that views are a type of virtual tables and are a composition of tables too hence we can use the same query to get the structure of a view which we use to get the structure of a table. In other words, we can use DESCRIBE statement to get the structure of a MySQL view. Its syntax would be as follows −SyntaxDESCRIBE view_name;Here, view_name is the name of the view of which we want to get the structure.ExampleSuppose we want to get the structure of a view named ‘Info’ then it can be done with the help, of the following query ... Read More

164 Views
With the help of DROP VIEW statement, we can drop a MySQL view from the database. Its syntax would be as follows −SyntaxDROP VIEW [IF EXISTS] view_name;Here view_name is the name of the view which we want to delete from the database.ExampleSuppose if we want to drop a view named info_less then the following query will delete if −mysql> DROP VIEW IF EXISTS Info_less; Query OK, 0 rows affected (0.03 sec)

177 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, connection );Followings are the parameters used in this function −S. No.Parameter & Description1.SqlRequired - SQL query to fetch data from an existing MySQL table2.connectionOptional - if not specified, then the last opened connection by mysql_connect will be used.mysql_fetch_array() functionThis is another function which is used in PHP script while fetching ... Read More

609 Views
As we know that PHP provides us the function named mysql_query to insert data into an existing MySQL table.ExampleTo illustrate this we are inserting data into a table named ‘Tutorials_tbl’ with the help of PHP script in the following example − Add New Record in MySQL Database

134 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 to insert data into an existing MySQL table2.connectionOptional - if not specified, then the last opened connection by mysql_connect will be used.