我A而的代码
<FORM METHOD=POST ACTION="play.php">
<?php
mysql_connect("localhost","hedejiang","hedejiang");
mysql_select_db("hedejiang");
mysql_query("SET NAMES 'utf8'");
$sql="SELECT * FROM `imusic` LIMIT 0 , 5";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
$id=$row['imusic_id'];
$name=$row['imusic_name'];
echo "<hr/>";
echo $id."<INPUT TYPE=\"checkbox\" NAME=\"checkbox[]\" value=\"$id\">".$name;
}
?>
<hr/>
<INPUT TYPE="submit" ONCLICK="">
</FORM>
我B页面的代码
<?php
if($_POST!=""){
$p=$_POST['checkbox'];
print_r($p);
echo "<br/>";
foreach($p as $k=>$v){
echo $v.'<br />';
//$id=$v;
}
}
mysql_connect("localhost","hedejiang","hedejiang");
mysql_select_Db("hedejiang");
$sql="select * from `imusic` where `imusic`.`imusic_id`='$p'";
$query=mysql_query($sql);
$assoc=mysql_fetch_assoc($query);
echo $assoc['imusic_name'];
?>
请问一下怎么最最显示出A页面提交过来的ID在数据中的相应数据!!!!