I am trying to update my table with what you choose from the drop down menu and then you put text into the text box and it will update a specific column (fixture_result). The output is telling me it's updated but when I look at the database it hasn't done it.
I don't know if this question has been asked before. I looked through a few forms related to updating and they didn't help much; but if you see what I am doing wrong I would appreciate it.
<html>
<head>
<title>The Score</title>
</head>
<body>
<form id="form1" name="form1" method="post">
Fixture:
<select name='NEW'>
<option value="">--- Select ---</option> <br>
<?php
if(isset($db_name)&&$db_name!=""){
$select=$_POST['NEW'];
}
?>
<?php
$list=mysql_query("select * from Fixture_Information order by fixture_id asc");
while($row_list=mysql_fetch_assoc($list)){
?>
<option value="<?php echo $row_list['fixture_id']; ?>">
<?php if($row_list['fixture_id']==$select){ echo "selected"; } ?>
<?php echo $row_list['fixture_name']; ?>
</option>
<?php
}
?>
Input Score: <input type="text" name="myusername">
<input type="submit" value="Submit">
<?php
$data =$_POST['myusername'];
$select=$_POST['NEW'];
$sql=("UPDATE Fixture_Information
set fixture_result = '$data'
where fixture_name = '$select'");
$checkresult = mysql_query($sql);
if ($checkresult) echo 'update query succeeded';
else echo 'update query failed';
mysql_close();
?>
</select>
</form>
</body>
</html>