- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 1466 Articles for PHP
4K+ Views
We can use the syntax of MySQL JOIN for joining two tables into the PHP function – mysql_query(). This function is used to execute the SQL command and later another PHP function – mysql_fetch_array() can be used to fetch all the selected data.To illustrate it we are having the following example −ExampleIn this example, we are using two MySQL tables which have the following data −mysql> SELECT * FROM tcount_tbl; +-----------------+----------------+ | tutorial_author | tutorial_count | +-----------------+----------------+ | mahran | 20 | | mahnaz | ... Read More
266 Views
We can use the similar syntax of the WHERE...LIKE clause into the PHP function – mysql_query(). This function is used to execute the SQL command and later another PHP function – mysql_fetch_array() can be used to fetch all the selected data if the WHERE...LIKE clause is used along with the SELECT command.But if the WHERE...LIKE clause is being used with the DELETE or UPDATE command, then no further PHP function call is required.To illustrate it we are having the following example −ExampleIn this example, we are writing a PHP script that will return all the records from the table named ‘tutorial_tbl’ ... Read More
214 Views
We can use the SQL DELETE command with or without the WHERE CLAUSE into the PHP function – mysql_query(). This function will execute the SQL command in a similar way it is executed at the mysql> prompt. To illustrate it we are having the following example − Example In this example, we are writing a PHP script to delete a record from MySQL table named ‘tutorial_tbl’ whose tutorial_id as 3.
201 Views
We can use the SQL UPDATE command with or without the WHERE CLAUSE in the PHP function – mysql_query(). This function will execute the SQL command in a similar way it is executed at the mysql> prompt. To illustrate it we are having the following example −ExampleIn this example, we are writing a PHP script to update the field named tutorial_title for a record having turorial_id as 3.
567 Views
If we want to fetch conditional data from MySQL table then we can write WHERE clause in SQL statement and use it with a PHP script. While writing the PHP script we can use PHP function mysql_query(). This function is used to execute the SQL command and later another PHP function mysql_fetch_array() can be used to fetch all the selected data. This function returns a row as an associative array, a numeric array, or both. This function returns FALSE if there are no more rows. To illustrate it we are having the following example −ExampleIn this example we are writing ... Read More
190 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’.
161 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()
525 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 −
To Continue Learning Please Login
Login with Google