I have the following drop down list
<form form action="" method="POST">
<div class="w-container">
<select class="w-select select-range" id="field" name="field" onchange='this.form.submit()'>
<option value="range_1">select Week Range</option>
<option value="Week 1" <?php if(isset($_POST['week']) && $_POST['week'] == 2){ ?> selected="selected" <?php } ?>>Week 2</option>
<option value="Week 2" <?php if(isset($_POST['week']) && $_POST['week'] == 3){ ?> selected="selected" <?php } ?>>Week 3</option>
</select>
<noscript><input type="submit" value="submit"></noscript>
</div>
</form>
And the I've got the following query
if(ISSET($_POST['week']))
{ $weekette = mysql_real_escape_string($_POST['week']); }
else{($weekette=1);}
function query_create_games($weeker){
$query = "SELECT * FROM fixtures WHERE week=$weeker";
going through the while loop etc
Before I added the else{($weekette=1);}
I was getting an error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
With the else there, it only returns results for week 1, when it should return results for week 2 or 3 respectively.
It seems as if the form isn't passing through the information to the post.
Am I missing something here?