$db = mysql_connect("localhost", "root", "password");
mysql_select_db("mydb",$db);
if (isset($_POST['name'])) {
echo "你输入的用户是:". $_POST['name'];
}
$result = mysql_query("SELECT * FROM employees WHERE name='".$_POST['name']."'",$db);
while ($fields = mysql_fetch_row($result)) {
$data[] = $filelds;
}
if(!empty($data)){
foreach($data as $val){
foreach($val as $k => $v){
echo $k." ".$v."
";
}
echo "
要数据库么