I need to know how to retrieve a value from a MySql database to a radio button on a HTML form. I have been able to retrieve the text field, just not the radio buttons.
i need to update the account values using php but i cant retrieve value from radio button please see the code and help me get of of this frustrating situation.
PHP Code:
<?php include("../includes/config.php"); ?>
if ($_SESSION["isadmin"])

if (!
$con) { die('Could not connect: ' mysql_error()); }

$result mysql_query("SELECT * FROM accounts WHERE (id='".$accountid."')");

$row mysql_fetch_array($result))
$firstname $row['firstname'];
$lastname $row['lastname'];
<title>Edit User</title>
<link rel="StyleSheet" href="../admin/css/style.css" type="text/css" media="screen">

<?php include("../admin/includes/header.php"); ?>
include("../admin/includes/nav.php"); ?>
include("../admin/includes/manage-users-aside.php"); ?>
<div id="maincontent">

    <div id="breadcrumbs">
        <a href="">Home</a> >
         <a href="">Manage Users</a> >
         <a href="">List Users</a> >
         Edit User
    <h2>Edit User</h2>

    <form method="post" action="users-edit-action.php">
    <input type="hidden" value="<?php echo $accountid?>" name="id" />
    <label>Email/Username:</label><input type="text" name="email" value="<?php echo $email?>" /><br /><br />
    <label>Password:</label><input type="password" name="password" value="<?php echo $password;?>" /><br /><br />
    <label>First Name:</label><input type="text" name="firstname" value="<?php echo $firstname?>" /><br /><br />
    <label>Last Name:</label><input type="text" name="lastname" value="<?php echo $lastname?>" /><br /><br />
    <label>Type:</label><br />
    <input type="radio" name="type" value="Student""<?php echo $type;?>" /> Student<br />
    <input type="radio" name="type" value="Teacher""<?php echo $type?>" /> Teacher<br />

        <input type="submit" value="Edit" />


<?php include("../admin/includes/footer.php"); ?>
header("Location: ".$fullpath."login/unauthorized.php");

please tell me where iam wrong and how to solve it correctly.thanks