The SQL SELECT statement is used to select the records from database tables.
The basic syntax of the select clause is –
To select all columns from the table, the character is used.
Implementation of the Select Query :
Let us consider the following table ‘ Data ‘ with three columns ‘ FirstName ‘, ‘ LastName ‘ and ‘ Age ‘.
To select all the data stored in the ‘ Data ‘ table, we will use the code mentioned below.
SELECT Query using Procedural Method :
- The “res” variable stores the data that is returned by the function mysql_query().
- Everytime mysqli_fetch_array() is invoked, it returns the next row from the res() set.
- The while loop is used to loop through all the rows of the table “data”.
SELECT Query using Object Oriented Method :
SELECT Query using PDO Method :
- PHP | MySQL UPDATE Query
- PHP | MySQL Delete Query
- SQL | SELECT Query
- SQL | Query to select NAME from table using different options
- MySQL | Common MySQL Queries
- PHP | DOMXPath query() Function
- How to get multiple selected values of select box in php?
- How to select and upload multiple files with HTML and PHP, using HTTP POST?
- PHP | MySQL Database Introduction
- PHP | MySQL ( Creating Database )
- PHP | MySQL ( Creating Table )
- PHP | Inserting into MySQL database
- PHP | MySQL ORDER BY Clause
- PHP | MySQL WHERE Clause
- PHP | MySQL LIMIT Clause
- PHP date() format when inserting into datetime in MySQL
- How to Display Recent Posts in DOM using PHP and MySQL ?
- Signup form using PHP and MySQL Database
- SQL | Query Processing
- Join operation Vs Nested query in DBMS
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.