View Full Version : Resolved Problem with updating INT value, using radiobutton

02-25-2010, 11:13 AM
Hi all,
I'm using a form to update the INT value of a sql table field called "frontpage". i use the following code

$updateSQL = sprintf("UPDATE trips SET frontpage=%s WHERE id=%s",
GetSQLValueString($_POST['frontpage'], "int"),
GetSQLValueString($_POST['id'], "int"));

mysql_select_db($database_seasons_con, $seasons_con);
$Result1 = mysql_query($updateSQL, $seasons_con) or die(mysql_error());

<label><input type="radio" name="fronpage" value="1" id="fronpage_0" />Yes</label>
<label><input type="radio" name="fronpage" value="0" id="fronpage_1" />No</label>

The problem is that the "frontpage" value is always passed as "null" in database which means that the radio button value can't be accessed properly. What am I doing wrong here? Can you help me?

02-25-2010, 11:46 AM
Your radio button names are missing the T in front, name="fronpage" instead of name="frontpage".

02-26-2010, 12:33 PM
that was stupid, I'm really sorry for this. Sometimes the mistake is in front of your eyes and you go blind. I was trying to fix this yesterday testing a million possible solutions. I feel really stupid.