<?php
// Attempt to connect to the default database server
$link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
or die ("Could not connect");
$select_db=mysql_selectdb("mydb");
//returns result set on executing the query
$rst=mysql_query("select * from employee",$link);
echo "id,name,salary<br>";
//fetches each row of result set as an array
while($res=mysql_fetch_row($rst)){
//display the values using numeric array index
echo "$res[0],$res[1],$res[2]<br>";
}
?>