hey,I've been using php and mysql to code my site (well, I'm using the mx-system, but my own blocks at least), and I've come across a problem.Code Below
<?$query="SELECT * FROM episodes";$result=mysql_query($query);$num=mysql_numrows($result); ?><table width="100%" cellpadding="2" cellspacing="2" class="forumline"> <thead> <caption> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="forumheader"> <tr> <td align="left" valign="bottom" width="19"> <img src="../templates/Getaway/images/hdr_left.gif" width="19" height="22" alt="" /> </td> <td align="left" class="forumheader-mid"> Episodes </td> <td align="right" valign="bottom" width="19"> <img src="../templates/Getaway/images/hdr_right.gif" width="19" height="22" alt="" /> </td> </tr> </table> </caption> </thead> <tbody> <tr> <th>ID</th> <th>Season/Episode</th> <th>Title</th> </tr> <? $i=0; while ($i < $num) { $ID=mysql_result($result,$i,"ID"); $Season=mysql_result($result,$i,"Season"); $Episode=mysql_result($result,$i,"Episode"); $Title=mysql_result($result,$i,"Title"); ?> <tr> <td class="row1"><span class="gensmall"><a href="index.php?page=5&episode="<? echo '$ID'; ?>""><? echo "$ID"; ?></a></span></td> <td class="row1"><span class="gensmall">Season <? echo "$Season"; ?>, Episode <? echo "$Episode"; ?></span></td> <td class="row1"><span class="gensmall"><? echo "$Title" ?></span></td> </tr> <? ++$i; } ?> </tbody></table>
Now, what is wrong is, I want the Episode ID to appear in the <a> link, so I can use the GET function on the next page to take all info out of the db where the id is equal to that.what actually happens is, when the link is meant to say for example
.../index.php?page=5&episode=101
with the text saying the same episode id (101 in this case)what is actually said is
.../index.php?page=5&episode=101
the text is still there though saying that episode id.I can't think of a reason as to why this is happening.Any help would be appreciated.Aaronerm.. actually I sorted this out.I changed the bit I struggled with to this:
<a href="index.php?page=5&episode=<? echo "$ID"; ?>">
I just looked at it on after I posted it on here and wondered why I put them there.thanks anyhow.