jedney Posted February 24, 2008 Share Posted February 24, 2008 Hello, I am trying something new, trying to pull information from more than one table, and making multiple isset caules within one page. Somewhere, I messed up because my page returns blank. I have the page (matches.php) and various issets (id=, type=, format=). I'm unsure why my page is blank though. Also, if you notice where I have the isset's at for the type and format, I have it set up to say "WHERE type = TPG". Is there a way where I don't have to enter the actual value of the type field? Because over time, there would be many types, and I would hate to have to write in additional code, everytime there was a new type. I just don't know/can't find how to do it. Here is my code. <?php if (isset($_GET['id'])) { $query = "SELECT * FROM matches WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['type'] . " " . $row['format'] . " on " . $row['date'] . " vs. " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Date: " . $row['date'] . "</td> </tr> <tr> <td class=\"norm\">Time: " . $row['time'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Match Type: " . $row['type'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['format'] . "</td> </tr> <tr> <td class=\"norm\">Map: " . $row['map'] . "</td> </tr> <tr> <td class=\"norm\">Score: " . $row['score'] . "</td> </tr> <tr> <td class=\"norm\">Match Result: " . $row['result'] . "</td> </tr> <tr> <td class=\"normbold\">Match Write Up</td> </tr> <tr> <td class=\"norm\">" . $row['writeup'] . "</td> </tr>"; } if (isset($_GET['opp'])) { $query = "SELECT * FROM opponents WHERE opp = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['name'] . "</td> </tr> <tr> <td class=\"norm\">Clan Tag: " . $row['tag'] . "</td> </tr> <tr> <td class=\"norm\">IRC Channel: " . $row['irc'] . "</td> </tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = '3v3'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 3v3 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = '6v6'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 6v6 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = 'tpg'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> TPG Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } else { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION $query = "SELECT * FROM files"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } } } } } ?> Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 *BUMP* Worked on the script some more, looking around the web for some reason on why nothing on this page is working, still nothing. Any suggestions? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 25, 2008 Share Posted February 25, 2008 try removing the get variable out of the statement with the brackets and define that inside a variable then call that variable in in the statement. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 Turn on error reporting in your php.ini and it will show you the error instead of a blank page. Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 Turn on error reporting in your php.ini and it will show you the error instead of a blank page. I dont have access to the php.ini, this web hosting is on a hosted server. I can never get PHP to work on my PC, or else I would have done all of my testing on my PC. Jon Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 You can use ini_set Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 You can use ini_set I have set that value through PHP and the page still comes up blank. Did I set the code right? <?php ini_set(error_reporting(1)); // Rest of my Code ?> Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 25, 2008 Share Posted February 25, 2008 try <?php error_reporting(E_ALL);> Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 try <?php error_reporting(E_ALL);> I have done your suggestion and I get nothing. When I do the below code, I get the following error: Warning: Wrong parameter count for ini_set() in /home/c575964/public_html/nlgb1/matches.php on line 81 The Code to get that error is: ini_set(error_reporting(E_ALL)); Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 25, 2008 Share Posted February 25, 2008 <?php ini_set('error_reporting', E_ALL); ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 If you got that error then error reporting is already on, which means the reason you are not getting output is because 'id' is not set. if (isset($_GET['id'])) All your code output relies on this first if statement, if it isn't true, you get nothing. All your other IF's are nested under this one. Should they be on the same level? Add a else at the bottom and echo something if 'id' is not set. Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 I tried moving things onto a different level and I still recieved a blank page. If this helps any, when I manually add ?id=1, the proper information shows up for what I called when id=# was showed. Does that add any information to the problem? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 What creates the URL that sends you to this page? Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 What creates the URL that sends you to this page? The first part of the if statement: <?php if (isset($_GET['id'])) { $query = "SELECT * FROM matches WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['type'] . " " . $row['format'] . " on " . $row['date'] . " vs. " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Date: " . $row['date'] . "</td> </tr> <tr> <td class=\"norm\">Time: " . $row['time'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Match Type: " . $row['type'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['format'] . "</td> </tr> <tr> <td class=\"norm\">Map: " . $row['map'] . "</td> </tr> <tr> <td class=\"norm\">Score: " . $row['score'] . "</td> </tr> <tr> <td class=\"norm\">Match Result: " . $row['result'] . "</td> </tr> <tr> <td class=\"normbold\">Match Write Up</td> </tr> <tr> <td class=\"norm\">" . $row['writeup'] . "</td> </tr>"; } Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 25, 2008 Share Posted February 25, 2008 <?php $id=$_GET['id']; if (isset($id)) { $query = "SELECT * FROM matches WHERE id =$id"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['type'] . " " . $row['format'] . " on " . $row['date'] . " vs. " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Date: " . $row['date'] . "</td> </tr> <tr> <td class=\"norm\">Time: " . $row['time'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Match Type: " . $row['type'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['format'] . "</td> </tr> <tr> <td class=\"norm\">Map: " . $row['map'] . "</td> </tr> <tr> <td class=\"norm\">Score: " . $row['score'] . "</td> </tr> <tr> <td class=\"norm\">Match Result: " . $row['result'] . "</td> </tr> <tr> <td class=\"normbold\">Match Write Up</td> </tr> <tr> <td class=\"norm\">" . $row['writeup'] . "</td> </tr>"; }else { echo "Could not select Rows!";} ?> Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 I have specified variables as shown below: <?php $id=$_GET['id']; $type=$_GET['type']; $format=$_GET['format']; if (isset($_GET['id'])) { // Rest of code is here ?> Yet, I am still recieving a blank screen when I go to the page, but if I manually enter ?id=1, I do get the proper information shown. I've been at this for a few hours now, unsure really what is wrong. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 25, 2008 Share Posted February 25, 2008 try changing mysql_fetch_array to mysql_fetch_assoc ??? Quote Link to comment Share on other sites More sharing options...
jedney Posted February 25, 2008 Author Share Posted February 25, 2008 I have made the adjustments you recommended, but I still am recieving a blank screen. the id?= if statement works, but none of the other 2, or the else statement does, so I am thinking I worded my if statement wrong? I am going to look around into that. Again, here is my code. <?php $id=$_GET['id']; $type=$_GET['type']; $format=$_GET['format']; if (isset($_GET['id'])) { $query = "SELECT * FROM matches WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['type'] . " " . $row['format'] . " on " . $row['date'] . " vs. " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Date: " . $row['date'] . "</td> </tr> <tr> <td class=\"norm\">Time: " . $row['time'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Match Type: " . $row['type'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['format'] . "</td> </tr> <tr> <td class=\"norm\">Map: " . $row['map'] . "</td> </tr> <tr> <td class=\"norm\">Score: " . $row['score'] . "</td> </tr> <tr> <td class=\"norm\">Match Result: " . $row['result'] . "</td> </tr> <tr> <td class=\"normbold\">Match Write Up</td> </tr> <tr> <td class=\"norm\">" . $row['writeup'] . "</td> </tr>"; } if (isset($_GET['opp'])) { $query = "SELECT * FROM opponents WHERE opp = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['name'] . "</td> </tr> <tr> <td class=\"norm\">Clan Tag: " . $row['tag'] . "</td> </tr> <tr> <td class=\"norm\">IRC Channel: " . $row['irc'] . "</td> </tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = '3v3'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 3v3 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = '6v6'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 6v6 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = 'tpg'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> TPG Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } else { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION $query = "SELECT * FROM matches"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } } } } } ?> Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 25, 2008 Share Posted February 25, 2008 <?php ini_set('error_reporting',E_ALL); $type=$_GET['type']; $format=$_GET['format']; if (isset($_GET['id'])) { $query = "SELECT * FROM matches WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['type'] . " " . $row['format'] . " on " . $row['date'] . " vs. " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Date: " . $row['date'] . "</td> </tr> <tr> <td class=\"norm\">Time: " . $row['time'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Match Type: " . $row['type'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['format'] . "</td> </tr> <tr> <td class=\"norm\">Map: " . $row['map'] . "</td> </tr> <tr> <td class=\"norm\">Score: " . $row['score'] . "</td> </tr> <tr> <td class=\"norm\">Match Result: " . $row['result'] . "</td> </tr> <tr> <td class=\"normbold\">Match Write Up</td> </tr> <tr> <td class=\"norm\">" . $row['writeup'] . "</td> </tr>"; } if (isset($_GET['opp'])) { $query = "SELECT * FROM opponents WHERE opp = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['name'] . "</td> </tr> <tr> <td class=\"norm\">Clan Tag: " . $row['tag'] . "</td> </tr> <tr> <td class=\"norm\">IRC Channel: " . $row['irc'] . "</td> </tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = '3v3'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 3v3 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = '6v6'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 6v6 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($_GET['type'])) { $query = "SELECT * FROM matches WHERE type = 'tpg'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> TPG Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } else { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION $query = "SELECT * FROM matches"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } } } } } ?> Quote Link to comment Share on other sites More sharing options...
jedney Posted February 26, 2008 Author Share Posted February 26, 2008 Well, here are some errors, I have no clue about them Notice: Undefined index: id in /home/c575964/public_html/nlgb1/matches.php on line 82 Notice: Undefined index: type in /home/c575964/public_html/nlgb1/matches.php on line 83 Notice: Undefined index: format in /home/c575964/public_html/nlgb1/matches.php on line 84 Notice: Undefined index: id in /home/c575964/public_html/nlgb1/matches.php on line 85 Line 82, 83, 84 & 85 is the following: $id=$_GET['id']; $type=$_GET['type']; $format=$_GET['format']; if ($_GET['id']) { Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted February 26, 2008 Share Posted February 26, 2008 on your form page are you using method="GET"? I've been wanting to ask all this time but I didn't want to come off as insulting Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 26, 2008 Share Posted February 26, 2008 cleaned up your code tell me what you get now ??? <?php ini_set('error_reporting',E_ALL); $type=$_GET['type']; $format=$_GET['format']; if (isset($id)) { $query = "SELECT * FROM matches WHERE id = $id"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['type'] . " " . $row['format'] . " on " . $row['date'] . " vs. " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Date: " . $row['date'] . "</td> </tr> <tr> <td class=\"norm\">Time: " . $row['time'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['opponent'] . "</td> </tr> <tr> <td class=\"norm\">Match Type: " . $row['type'] . "</td> </tr> <tr> <td class=\"norm\">Opponent: " . $row['format'] . "</td> </tr> <tr> <td class=\"norm\">Map: " . $row['map'] . "</td> </tr> <tr> <td class=\"norm\">Score: " . $row['score'] . "</td> </tr> <tr> <td class=\"norm\">Match Result: " . $row['result'] . "</td> </tr> <tr> <td class=\"normbold\">Match Write Up</td> </tr> <tr> <td class=\"norm\">" . $row['writeup'] . "</td> </tr>"; } if (isset($_GET['opp'])) { $query = "SELECT * FROM opponents WHERE opp = $id"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo " <td valign=\"top\" class=\"NewsHeader\"> " . $row['name'] . "</td> </tr> <tr> <td class=\"norm\">Clan Tag: " . $row['tag'] . "</td> </tr> <tr> <td class=\"norm\">IRC Channel: " . $row['irc'] . "</td> </tr>"; } if (isset($type)) { $query = "SELECT * FROM matches WHERE type = '3v3'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 3v3 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($type)) { $query = "SELECT * FROM matches WHERE type = '6v6'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> 6v6 Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } if (isset($type)) { $query = "SELECT * FROM matches WHERE type = 'tpg'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> TPG Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } else { echo "<tr> <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\"> Matches</td>"; echo "</tr>"; echo "<tr>"; echo "<td class=\"normbold\">Date & Time</td>"; echo "<td class=\"normbold\">Type & Format</td>"; echo "<td class=\"normbold\">Opponent</td>"; echo "<td class=\"normbold\">Map</td>"; echo "<td class=\"normbold\">Score</td>"; echo "<td class=\"normbold\">Result</td>"; echo "</tr>"; // DISPLAY NEWS INFORMATION $query = "SELECT * FROM matches"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<td class=\"norm\"><a href=\"matches.php?id=" . $row["id"] . "\">" . $row["date"] . "</a> " . $row['time'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?type=" . $row["type"] . "\">" . $row["type"] . "</a> " . $row['format'] . "</td>"; echo "<td class=\"norm\"><a href=\"matches.php?opp=" . $row["id"] . "\">" . $row["name"] . "</a></td>"; echo "<td class=\"norm\">" . $row['map'] . "</td>"; echo "<td class=\"norm\">" . $row['score'] . "</td>"; echo "<td class=\"norm\">" . $row['result'] . "</td>"; echo "</tr>"; } } } } } } ?> Quote Link to comment Share on other sites More sharing options...
jedney Posted February 26, 2008 Author Share Posted February 26, 2008 Same error with the code you posted. While you posted your reply, I had a reply, here is what I had. I'm not using a form. I'm trying so hard to describe what I am trying to do, it's hard without showing someone, especially being a 2-3 ona scale of 10 in PHP. If you look at this page: http://www.nlgaming.net/nlgb1/roster.php You will see the list from the table, and the linked names; clicking on the name will specify the specified id, I have the link for the name echo set up as roster.php?id=". $row["id"] ." This page I am having problems with is working the same way. The only thing is the date of the match, is linking to the ID, the format of the match, is to link to ?format= and the type is linked to ?type=. The roster page is good, but I am having this problem with I have the additional if statements, not just the one. Does that help any? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 26, 2008 Share Posted February 26, 2008 if you inserting your data as $_POST['data'] you can not fetch it using the get method. you must use post Quote Link to comment Share on other sites More sharing options...
jedney Posted February 26, 2008 Author Share Posted February 26, 2008 Hmm, I used GET on my other pages, and it worked fine. I changed it to $_POST and I still receive the same errors. I wonder if I should start from scratch again on the coding? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.