Jump to content

Update table issue


WilliamNova
Go to solution Solved by .josh,

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.