Select Data From Database in PHP:

To select data from database you have to use select query in PHP.

Syntax:

To select all data from table use following query

$sql = “select * from table_name”;

mysql_query($sql);

To select data from one or more columns use following query

$sql = “selcect column_name from table_name;”

mysql_query($sql);

Example:

 

Leave a Reply

Your email address will not be published. Required fields are marked *