How to make radio working?

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&nbsp;&nbsp;
        	
<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.:shifty:

Anymore? I suggest rolling back to to when it was working, and figuring out from the differences what’s responsible.

No backups? You can then instead use var_dump to echo the contents of $_POST so that you can be sure that the values you expect to be there, really are there.

Thanx pmw57 for the reply.

But it was all my silly mistake. I made the cell to accept int value and wanna insert the char value like yes and no.

And thus that was not able to update the db, While at the pulling data back from the db, I made a conditional statement like when the field is ‘0’ make the variable No. and when the field is 1, make the variable ‘Yes’. But didn’t do the same for updating the db.

lolz… Now I got my fault. :D:)