Found 4219 Articles for MySQLi

How can we fetch all the data from MySQL table by using mysql_fetch_array() function, returning an array with the numeric index, in PHP script?

Prabhas
Updated on 22-Jun-2020 13:39:30

548 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 −

How can we get the structure of a MySQL view as we can get the structure of a MySQL table?

Arjun Thakur
Updated on 22-Jun-2020 13:41:44

294 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

How can we drop a MySQL view from the database?

Akshaya Akki
Updated on 22-Jun-2020 13:43:50

81 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)

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

seetha
Updated on 22-Jun-2020 13:57:51

346 Views

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

How can we display all the records from MySQL table with the help of PHP script?

Priya Pallavi
Updated on 22-Jun-2020 13:52:00

854 Views

To illustrate this we are fetching all the records from a table named ‘Tutorials_tbl’ with the help of PHP script that uses mysql_query() and mysql_fetch_array() function in the following example −

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

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

91 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

How can we insert data into an existing MySQL table by using PHP script?

Anvi Jain
Updated on 22-Jun-2020 14:03:52

431 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              

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

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

78 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.

How can we delete an existing MySQL table by using PHP script?

Nitya Raut
Updated on 22-Jun-2020 13:43:01

99 Views

As we know that PHP provides us the function named mysql_query to delete an existing MySQL table.ExampleTo illustrate this we are deleting a table named ‘Tutorials_tbl’ with the help of PHP script in the following example −           Creating MySQL Tables                  

Which PHP function is used to delete an existing MySQL table?

Abhinanda Shri
Updated on 22-Jun-2020 13:44:39

78 Views

PHP uses mysql_query function to delete 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 delete an existing MySQL table2.connectionOptional - if not specified, then the last opened connection by mysql_connect will be used.

Advertisements