Found 1060 Articles for PHP

How can we write PHP script to release cursor memory associated with MySQL result?

usharani
Updated on 22-Jun-2020 14:03:17

279 Views

As we know that PHP uses the msql_free_result() function to release cursor memory associated with MySQL result. To illustrate it we are having the following example −ExampleIn this example, we are writing the following PHP script that will release the memory after fetching the records from a table named ‘Tutorials_tbl’.

Which PHP function is used to release cursor memory associated with MySQL result?

varun
Updated on 22-Jun-2020 14:06:01

210 Views

PHP uses mysql_free_result() function to release the cursor memory associated with MySQL result. It returns no value.SyntaxMysql_free_result(result);Followings are the parameters used in this function −Sr.NoParameter & Description1ResultRequired- Specifies a result set identifier returned by mysql_query(), mysql_store_result() or mysql_use_result()

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

729 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 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

432 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

1K+ 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

176 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

607 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

133 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

230 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

135 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