Jump to content

Adzyboy

Members
  • Posts

    2
  • Joined

  • Last visited

Adzyboy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Cheers for that.I have another problem now.I'm making the link to send the user to another page, where I use the $_GET variable to retrieve what the data is in the episode variable in the url.I get a problem when I try that page thoFatal error: Call to undefined function: array() in /home/adzyboy/public_html/episodes2.php on line 4the page is below: <?$episodeid=$_GET('episodeid');mysql_query("SELECT * from episodes WHERE ID='%$episodeid'");$ID=mysql_result("ID");$Season=mysql_result("Season");$Episode=mysql_result("Episode");$Title=mysql_result("Title");$Air_Date=mysql_result("Air Date");$Writer=mysql_result("Writer");$Director=mysql_result("Director");$Star=mysql_result('Star');$Guest_Star=mysql_result('Guest Star');$Notes=mysql_result('Notes');$Quotes=mysql_result('Quotes');$Reviews=mysql_result('Reviews');$TV_Rating=mysql_result('TV Rating');$Site_Rating=mysql_result('.net Rating');?><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"> Season <? echo "$Season" ?> :: Episode <? echo "$Episode" ?> </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><? echo "$Title" ?></th> </tr> <tr> <td class="row2"> <b>Episode Number</b> - <? echo "$ID" ?><br /> <b>Original Air Date</b> - <? echo "$Air_Date" ?><br /> <b>Director</b> - <? echo "$Director" ?><br /> <b>Writer</b> - <? echo "$Writer" ?><br /> <b>Star</b> - <? echo "$Star" ?><br /> <b>Guest Star</b> - <? echo "$Guest_Star" ?><br /> </td> </tr> <tr> <th>Notes</th> <td class="row2"> <? echo "$Notes" ?> </td> </tr> <tr> <th>Quotes</th> <td class="row2"> <? echo "$Quotes" ?> </td> </tr> <tr> <th>Reviews</th> <td class="row2"> <? echo "$Reviews" ?> </td> </tr> </tbody></table> I don't think I've done the mysql_result properly, but the rest seems fine.to sum it up, or to be clear, user goes to episodes.php, they click a link, say index.php?page=5&episode=101. on the page5 which is episodes2.php, I use the $_GET variable to retrieve the information that is contained in the episode variable in the url (in this case "101"), and use that episode id (101) to retrieve the information I need from the database.I don't know why it's coming up with that, kinda confusing.Help would be appreciated.Aaron
  2. 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.
×
×
  • Create New...