How to Select Individual Records

As well as showing the whole Database, PHP can be used to select individual records or records which match certain criteria. To do this you must use a variation of the SELECT query. To display the whole table you used the query:

SELECT * FROM tablename


If we just want to select records which have value=1 in the field1-name row we would use the following query:

SELECT * FROM tablename WHERE field1-name='1'


In the same way, you could select records based on any field in the database. You can also search in more fields by adding more:

field='value'


sections into the query.

For further reference, you can visit the official websites of PHP and MySQL.

One of the most important things about using PHP and MySQL is to have a PHP/MySQL specialized Host. Here are some of the things we are proud of:

  • We have long experience in providing technical support for PHP/MySQL-based web sites. Thanks to it our servers are perfectly optimized to offer the best overall performance for most PHP/MySQL applications.
  • We offer FREE installation of many PHP/MySQL applications including CMS systems, forums, galleries, blogs, shopping carts and more.
  • We provide several versions of PHP (PHP 5.0, PHP 5.1, PHP 5.2) on a per-folder basis.
  • We support both MySQL 4 and MySQL 5. We provide unlimited MySQL databases.
  • We develop comprehensive tutorials for the most popular PHP/MySQL scripts and a great variety of articles in our Knowledge Base.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Use PHP and MySQL

PHP is the most popular scripting language for web development. It is free, open-source and...

How to Connect to Your Database

You should establish a connection to the MySQL database. This is an extremely important step...

Creating a database table

Before you can do anything with your Database, you should create a table and set the...

Pear Modules

By default all AVHoster servers have the following Pear packages installed: Archive_Tar...

MySQL

MySQL Export: How to backup your MySQL Database? You can easily create a dump...

Powered by WHMCompleteSolution