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"); } ?> Link to comment https://forums.phpfreaks.com/topic/286432-update-table-issue/ Share on other sites More sharing options...
.josh Posted February 23, 2014 Share Posted February 23, 2014 The most immediate thing I see wrong is a comma after deleted='1', Link to comment https://forums.phpfreaks.com/topic/286432-update-table-issue/#findComment-1470205 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. Link to comment https://forums.phpfreaks.com/topic/286432-update-table-issue/#findComment-1470211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.