Changes

Jump to: navigation, search

Retrieving Data From a MySQL Database

598 bytes added, 18:52, 9 October 2007
Using SELECT to Retrieve Mutiple Columns
<pre>
SELECT * FROM product;
</pre>
 
== Restricting Number of Results ==
 
When retrieving data from a table it is possible to limnit the number of results that are returned by the ''SELECT'' statement using the ''LIMIT'' keyword. This keyword is followed by a number indicating how may rows are to be retrieved:
 
<pre>
SELECT * FROM product LIMIT 10;
</pre>
 
The above command will retrieve only 10 rows from the database table. Both the start and end rows can be specified for reading further into a table. The following example, therefore, extracts rows 10 through 15 of the table:
 
<pre>
SELECT * FROM product LIMIT 10, 15;
</pre>

Navigation menu