Jump to content

Update table issue


WilliamNova

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.