Forums

PHP

This topic is locked

PHP Include script to Match same id as rest of row

Posted 05 Sep 2008 22:44:54
1
has voted
05 Sep 2008 22:44:54 ed chivers posted:
Hi,
I am stuck on something:
This code creates a page of song information, looks if a box has been ticked, and if so includes an mp3 player, ("playercode.php"

<?php do { ?><tr>
<td valign="top"><?php echo $row_rs_orch['title']; ?></td>
<td valign="top"><?php echo $row_rs_orch['date']; ?></td>
<td valign="top"><?php echo $row_rs_orch['inst']; ?><br />
<?php if ($row_rs_orch['playerCode'] == "1" include ("playercode.php";?>
<br /></td>
<td valign="top"><div align="center"><a href="music_detail.php?id=<?php echo $row_rs_orch['id']; ?>">more...</a></div></td>
</tr><?php } while ($row_rs_orch = mysql_fetch_assoc($rs_orch)); ?>

That all works fine. This is the playercode.php script;

<script language="JavaScript" src="www.awebaddress.co.uk/music/audio-player.js"></script>;
<object type="application/x-shockwave-flash" data="www.awebaddress.co.uk/music/player.swf" id="audioplayer<?php echo $row_rs_ensm['id'];?>" height="24" width="290">
<param name="movie" value="www.awebaddress.co.uk/music/player.swf">
<param name="FlashVars" value="playerID=<?php echo $row_rs_ensm['id'];?>&soundFile=www.awebaddress.co.uk/music/<?php echo $row_rs_ensm['link'];?>">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>

This will insert a Flash based mp3 player (which also works).

The problem is the rows of the playercode.php PHP script do not match up with the main page results so the mp3 players appear with the wrong songs!

Any help greatly appeciated!

Reply to this topic