I am looking to update a table column on a form submit using mySQL.
ie.
<form action="<?=$_SERVER['PHP_SELF']; ?>" method="post">
<fieldset>
<div data-role="fieldcontain">
<label for="status" class="select">Current Status:</label>
<select name="status" id="status">
<option value="Open">Open</option>
<option value="Closed">Closed</option>
</select>
</div>
<input type="submit" data-theme="a" name="submit" value="submit-value"></input>
</fieldset>
</form>
<?php
if(isset($_POST['submit'])) {
$query = "UPDATE vtiger_troubletickets SET status='".addslashes($_POST['status'])."' WHERE ticket_no='".$ticket['ticket_no']."'";
echo $query;
mysql_query($query);
}
?>
updated
The query I have in place works in mysql correctly, except on my form submit the database is not updating. I have tried the input and button tag for the 'Submit.' Everything is connected as I have previously tested it all with a connect script. Any ideas as to why this is not updating my columns?