Hello,
im very new in the php and mysql world, so i have a problem with the sql database.
i have a form.php:
<form method="post" action="answer.php">
<input type="radio" name="sugu" value="yes" />
<input type="radio" name="sugu" value="no" />
</form>
and answer.php:
$con = mysql_connect("**********.com","****","***");
if (!$con) { die('err: '. mysql_error()); }
else { echo 'ahhaaa'; }
mysql_select_db("dbbbb",$con);
$sql =
"
INSERT INTO vastused(sugu)
VALUES ('$_POST[sugu]')
";
mysql_query($sql,$con);
if (!mysql_query($sql,$con))
{
echo 'ei, Error:'.'<br/>'.mysql_error();
}
mysql_close($con);/*
code inserts the answer twice into to the table. What am i doing wrong or what should i add?