Xtremer360 Posted October 31, 2009 Share Posted October 31, 2009 I don't know what I'm doing wrong. What I want to happen is when I want to edit the name of a division I click on edit next to the division name and it takes me to the editdivision function where it should go to the DB and grab the name but it isn't. I'm not sure what I'm doing wrong? function divisions() { print '<h1 class="backstage">Division Management</h1><br />'; print "<h2 class=backstage>Divisions :: <a href=\"#\" onclick=\"ajaxpage('adddivision', 'content'); return false;\">Add New</a></h2><br />"; $query = "SELECT * FROM divisions ORDER BY `division`"; $result = mysql_query ( $query ); // Run The Query $rows = mysql_num_rows($result); if ($rows > 0) { print '<table width="100%" class="table1">'; print '<tr class="rowheading">'; print '<td> </td>'; print '<td>Name</td>'; print '</tr>'; // Fetch and print all records. $i = 0; $current_row = 0; while ( $row = mysql_fetch_array ( $result, MYSQL_ASSOC ) ) { $current_row++; $sClass = 'row2'; if ($i ++ & 1) { $sClass = 'row1'; } printf ( "<tr class=\"%s\">", $sClass ); print "<td valign=\"top\" align=\"center\" width=\"30\"><a href=\"#\" onclick=\"ajaxpage('editdivision', 'content', '".$row['division']."'); return false;\">Edit</a></td>"; printf ( "<td valign=\"top\">%s</td>", $row [division] ); print '</tr>'; } echo '</table>'; } else { print '<span>There are no divisions.</span><br />'; } print '<br />'; returnmain(); } function editdivision() { $division = $_GET['division']; $query = mysql_query("SELECT * FROM `divisions` WHERE `division` = '" . $division . "'"); $row = mysql_fetch_array($query); print '<h1 class="backstage">Division Management</h1><br />'; print '<h2 class="backstage">Edit Division</h2><br />'; print '<form name="editmatchtype" method="post" action="backstage.php" id="editmatchtype">'; print '<table width="100%" class="table2">'; print '<tr>'; print "<td width=\"120\" class=\"rowheading\" valign=\"center\">Division:</td><td class=\"row3\"><input type=\"text\" name=\"division\" class=\"fieldtext490\" value=\"".$row['division']."\"></td>"; print '</tr>'; print '</table><br />'; print '<center>'; print '<input type="checkbox" name="deletedivision"><span class="table1heading">Delete Division?</span><br /><br />'; print '<input type="hidden" name="division" value="'.$division.'">'; print '<input type="hidden" name="olddivision" value="'.$row['division'].'">'; print '<input type="submit" value="Edit Division" class=button name="editdivision"><br /><br />'; print '<input type="button" value="Return to Divisions List" class="button200"><br /><br />'; returnmain(); } 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.