I’m developing a site in which I’m unable to update the radio into the database.
I mean to say, first I need to populate the content into the site by pulling out the information from database, then needed to update as per the user preference.
So here I’m able to fetch and populate the site, but then not able to update the database with the new preference of the user.
Here is my full markup
//s for show
$ssql = "select * from incomeinfo where uid=$uid";
$sres = query($ssql);
$srow = mysql_fetch_assoc($sres);
echo "<pre>";
print_r($srow);
echo "</pre>";
After POST here is my sql query
$sql = "update incomeinfo set employerCat='$employer', Basic='".@$basic."', DA='".@$DA."',
HRA='".@$HRA."', actualRent='".@$rent."', [B][COLOR="Red"]metroHouse='$house',[/COLOR][/B]
conveyance='".@$conveyance."', special='".@$special."',
incentives='".@$incentives."', bonus='".@$bonus."', EPF='".@$EPF."'";
And here is my radio markup on the site, which is visible to user and to which they can interact
<td class="income"><label for="house">House in any metro: <br /><span id="metro">Delhi, Mumbai, Kolkata, Chennai</span></label>
</td>
<td class="radio">
<input type="radio" name="house" value="Yes" <?php if(isset($_POST) && @$_POST['house'] == 'Yes') { echo 'checked="checked"'; } elseif(isset($srow) && $srow['metroHouse'] == 1) { echo 'checked="checked"'; } ?>/>Yes
<input type="radio" name="house" value="No" <?php if(isset($_POST) && @$_POST['house'] == 'No') { echo 'checked="checked"'; } elseif(isset($srow) && $srow['metroHouse'] == 0) { echo 'checked="checked"'; } ?> />No
</td>
Here I’ve highlighted the relevant option in sql syntax in red as well bold.
How to make this working ? As it is not recognizing the POST any more, so not updating the database.![]()