//1, connect to the database
$conn = mysql_connect('localhost','root','root');
if(!$conn){
die("Connection failed".mysql_error);
}
//2, select database
mysql_select_db("test");
//3, send operation statement
$sql="select * from user";
//4, receive results
$res= mysql_query($sql,$conn);
//5, traversal results
while($row=mysql_fetch_row($res)){
echo "
$row[0]--$row[1 ]--$row[2]";
}
.