WilliamNova Posted February 23, 2014 Share Posted February 23, 2014 I'm trying to complete a page where, when you click a button, it'll change a column from 0 to 1. I copied the code form another page of mine that's similar. I just changed the variables to match what I'm trying to change, so I'm not sure why it's not updating. delete_schedule.php <?php include ('./include/header.php'); $schedule_id = $_GET['schedule_id']; include ('./include/functions/deleteScheduleFunction.php'); ?> <div id="indexContainer"> <?php include ('./include/navigation.php'); ?> <div class='header'> Are You Sure? </div> <div class='indexBox'> Please confirm that you wish to delete this schedule. If you only need to edit the schedule you do not need to delete it, <a href=''>you can edit it here</a>.<br /> <br /> <form action='' method='POST'> <input type='hidden' name='deleted' value='1' /> <input type='submit' name='update' value='I am sure - Delete this schedule' /> </form> </div> <?php include ('./include/footer.php'); ?> </div> deleteScheduleFunction.php <?php if (isset($_POST['deleted'])) { $deleted = mysql_real_escape_string($_POST['deleted']); // Update mysql_query("UPDATE schedules SET deleted='1', WHERE schedule_id='$schedule_id'"); header("Location: home.php"); } ?> Quote Link to comment Share on other sites More sharing options...
Solution .josh Posted February 23, 2014 Solution Share Posted February 23, 2014 The most immediate thing I see wrong is a comma after deleted='1', Quote Link to comment Share on other sites More sharing options...
WilliamNova Posted February 23, 2014 Author Share Posted February 23, 2014 Can't believe I didn't notice that. Removing the comma did the trick. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.