<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>music_update</title>
</head><body>
<?php
//connect mysql
include_once "conn.php";
$number=$_GET['update'];
$result=mysql_query("select * from music where number='$number'");
$arr=mysql_fetch_array($result);
print_r($arr);
if ($arr){?><form action="" method="post">
<table width="800" border="1" cellspacing="0" cellpadding="0">
<tr>
<td align="center">number</td>
<td align="center">music_name</td>
<td align="center">href</td>
</tr>
<tr>
<td align="center"><?php echo $arr['number']?></td>
<td align="center"><input type="text" name="music_name" value="<?php echo $arr['music_name'];?>" size="30"/>
<?php if ($arr['music_name']==""){ echo "<font color='#ff0000'> * music_name is not null</font>";}else{ echo "<font color='#0000ff'>music_name is true</font>";}?></td>
<td align="center"><input type="text" name="href" value="<?php echo $arr['href'];?>" size="30"/>
<?php if ($arr['href']==""){ echo "<font color='#ff0000'> * href is not null</font>";}else{ echo "<font color='#0000ff'>href is true</font>";}?></td>
</tr>
<tr>
<td align="center" colspan="3"><input type="submit" name="update" value="update" /> <input type="reset" name="reset" value="reset" /></td>
</tr>
</table>
</form>
<?phpif ($arr['music_name']&&$arr['href']){$result_one=mysql_query("update music set music_name='$_POST[music_name]',href='$_POST[href]' where number='$number'")or die("not successful");
echo "<br/>";
echo "<p><font color='#0000FF'>update is successful,please select the table</font></p>";
}else{
echo "<br/>";
echo "<p><font color='#FF0000'>update is not successful,please reset it</font></p>";
}
}
?></body></html>
echo "<br/>";
echo "<p><font color='#0000FF'>update is successful,please select the table</font></p>";
}else{
echo "<br/>";
echo "<p><font color='#FF0000'>update is not successful,please reset it</font></p>";
}
}
?>
其他的自己检查检查.