passed information has to display as editable radio button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Izzy123
    New Member
    • Apr 2010
    • 7

    passed information has to display as editable radio button

    We were given a database which contains the informations of different ratings (1-4). We have to call the informations from the database about the ratings and display them as radio buttons, and to make them editable by the manager. Below is part of my code for the ratings:

    Code:
    <?php
    $conn1 = mysql_connect("localhost", "TWA", "test");
    mysql_select_db("performancereview", $conn1)
    or die ('Database not found ' . mysql_error() );
    
    $reviewid1 = mysql_real_escape_string($_GET['reviewid']);
    $sql1 = "SELECT jobknowledge FROM reviews WHERE reviewid = '$reviewid1' ";
    $rs1 = mysql_query($sql1, $conn1)
    or die ('Problem with query' . mysql_error());
    ?>
    
    <?php while($row1 = mysql_fetch_array($sql1)) { ?>
    
    <div class="left1"><table class="table1"><tr><td class="width1">
    <div class="left"><table class="table2">
    <tr>
    <td>&nbsp;</td>
    <td>1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
    </tr>
    <tr>
    <td>Job Knowledge</td>
    <td><input type="radio" name="jobKnowledge" value="1"/></td>
    <td><input type="radio" name="jobKnowledge" value="2"/></td>
    <td><input type="radio" name="jobKnowledge" value="3"/></td>
    <td><input type="radio" name="jobKnowledge" value="4"/></td>
    </tr>
    
    </table></div>
    </td></tr></table></div>
    <table>
    <?php }
    mysql_close($conn1); ?>
    I'm not sure how to call the values from the database and display them as the radio button.

    The rating for job knowledge in the database is 1, so we have to check the 1st radio button but make it editable.

    can anyone please help, thanks.
Working...