Jump to content

Not showing values for edit form


Xtremer360

Recommended Posts

function arenas() 
{
 $country = $_GET['country'];
$query = mysql_query("SELECT * FROM `arenas` WHERE `country` = '" . $country . "'");
     $row = mysql_fetch_array($query); 
print '<h1 class="backstage">Arena Management</h1><br />';
    print "<h2 class=\"backstage\">".$country." Arenas ::  <a href=\"#\" onclick=\"addarena('addarena', 'content', '". $country ."'); return false;\">Add New Arena</a></h2><br />";
     $query = "SELECT * FROM arenas  WHERE `country` = '" . $country . "' ORDER BY `citystate`";
$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>City</td>';
	print '<td>Arena</td>';
	print '<td align="center">Capacity</td>';
	print '</tr>';
	// Fetch and print all records.
	$i = 0;
	while ( $row = mysql_fetch_array ( $result, MYSQL_ASSOC ) ) 
	{
		$sClass = 'row2';
		if ($i ++ & 1) 
		{
			$sClass = 'row1';
		}
		printf ( "<tr class=\"%s\">", $sClass );
		print "<td valign=\"top\" align=\"center\" width=\"30\"><a href=\"#\" onclick=\"editarena('editarena', 'content' , '". $row ['arena'] ."'); return false;\">Edit</a></td>";
		printf ( "<td valign=\"top\">%s</td>", $row [citystate] );
		printf ( "<td valign=\"top\">%s</td>", $row [arena] );
		printf ( "<td valign=\"top\" align=\"center\">%s</td>", $row [capacity] );
		print '</tr>';
        }
	echo '</table><br />';
    }
else 
    {
    print '<span>There are no arenas for this country.</span><br /><br />';
    }
    print '<input type="button" value="Return to Country List" class="button200"><br /><br />';
    print '<h2 class="backstage"><input type="button" value="Return to Main Menu" class="button200"></form></h2>';
}  

 

function editarena() 
{
$arena = $_GET['arena']; 
$query = mysql_query("SELECT * FROM `arenas` WHERE `arena` = '" . $arena . "'");
     $row = mysql_fetch_array($query);  
print '<h1 class="backstage">Arena Management</h1><br />';
print '<h2 class="backstage">Edit Arena</h2><br />';
print '<form name="editarena" method="post" action="backstage.php" id="editarena">';
print '<table width="100%" class="table2">';
print '<tr>';
print "<td width=\"120\" class=\"rowheading\" valign=\"center\">Arena:</td><td class=\"row3\"><input type=\"text\" name=\"arena\" class=\"fieldtext490\" value=\"".$row['arena']."\"></td>";
print '</tr>';
print '<tr>';
print "<td width=\"120\" class=\"rowheading\" valign=\"center\">City, State:</td><td class=\"row3\"><input type=\"text\" name=\"citystate\" class=\"fieldtext490\" value=\"".$row['citystate']."\"></td>";
print '</tr>';
print '<tr>';
print "<td width=\"120\" class=\"rowheading\" valign=\"center\">Capacity:</td><td class=\"row3\"><input type=\"text\" name=\"capacity\" class=\"fieldtext140\" value=\"".$row['capacity']."\"></td>";
print '</tr>';
print '</table><br />';
print '<input type="checkbox" name="deletearena"><span class="table1heading">Delete Arena?</span><br /><br />';
print '<input type="hidden" name="oldarena" value="'.$row['arena'].'"> ';	
print '<input type="submit" value="Edit Arena" class=button name="editarena></form><br /><br />';
print '<input type="button" value="Return to Arena List" class="button200"><br /><br />';
print '<h2 class=backstage><input type="button" value="Return to Main Menu" class="button200"></form></h2>';
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.