Show all records from mysql table with PHP
Free Scripts :: PHP :: PHP and Mysql :: Show all records from mysql table with PHP
Author: Salman Javaid
Website: http://www.salman.be
Website: http://www.salman.be
- How to display all records from mysql table with php.
- Show mysql table records.
- List all records from mysql table.
- Fetch mysql table records with php.
This script displays all records from a mysql table.
Script:
$sql = mysql_query("select * from products");
while($row=mysql_fetch_array($sql)){
// display all records
foreach($row as $key=>$value){
echo $value;
}
//display selected fields e.g "product"
echo $row['product'] . ', ';
}
Output
nokia 6600, nokia E63, nokia 9300, nokia 9600, nokia e71,




