All - I need to display "yes or no" selected values for a radio button option and have the ability to update an option back to the database.
Here is the code:
Could someone help?
Here is the code:
Code:
<?php
// create database connection
include("includes/connection.php");
$id= $_GET['id'];
$query = "SELECT * FROM tblIndividuals WHERE id = $id";
// query the database
$queryID=odbc_exec($conn, $query);
$response = odbc_result($queryID,"response");
odbc_close($conn);
;?>
<div class="row">
<label>Response:</label>
<?php
if ($response = "Yes")
echo "<span class=\"inline\"><input type=\"radio\" class=\"radio\" name=\"response\" value=\"Yes\" checked />Yes</span>
<span class=\"inline\"><input type=\"radio\" class=\"radio\" name=\"response\" value=\"No\" />No</span>";
elseif ($response = "No")
echo "<span class=\"inline\"><input type=\"radio\" class=\"radio\" name=\"response\" value=\"Yes\" />Yes</span>
<span class=\"inline\"><input type=\"radio\" class=\"radio\" name=\"response\" value=\"No\" checked />No</span>";
else
echo "<span class=\"inline\"><input type=\"radio\" class=\"radio\" name=\"response\" value=\"Yes\" />Yes</span>
<span class=\"inline\"><input type=\"radio\" class=\"radio\" name=\"response\" value=\"No\" />No</span>";
?>
</div>
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="submit" id="submitbutton130" class="button positive" value="Edit Profile" />
</form>
Could someone help?