1. Home
  2. Computing & Technology
  3. PHP / MySQL

From MySQL Command

By Angela Bradley, About.com

Definition: From is used with Select in MySQL to choose what table to query from. You can choose to include more than one table by using a comma [,].
Examples:
SELECT * FROM Table_name;
This shows all data on the table called Table_name

SELECT address.person, city.name FROM city, address WHERE (city.zipcode = address.zipcode)
If you store a person's address in one table (we have called it address) and you store the names of the cities associated with each zip code in another table (we have called it city) then the above query will return the name of a person, and the name of their city. When using 2 tables, refer to the data fields as table.field.
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. MySQL Commands
  5. Select From SQL - From MySQL - Select From MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.