Jump to content

why will this not update????


jbrill

Recommended Posts

Hey guys,

Im trying to update some rows in my database and i cannot figure out why it will not update, as far as i know my statements are proper..

 

thanks in advance!

<?php
include 'admin_header.php'; 

$stepid = $_GET['stepid'];
//This gets data for the job and does the math equations
$results = "SELECT * FROM guestbook WHERE id='$stepid'";
$resultsql = mysql_query($results);
$result = mysql_fetch_array($resultsql);

//this updates the selected info
$update = "UPDATE guestbook SET actual_time='".$_POST['actual_time']."', complete='".$_POST['complete']."', cost='".$_POST['cost']."' WHERE id='$stepid'";


?>

<form method="post" name="updateinfo">
<input type="text" name="actual_time" value="<? echo "".$result["machine_time"]."";?>">
<input type="text" name="cost" value="<? echo "".$result["cost"]."";?>">
<br>
<table width="600" bgcolor="#ffffff" class="MainBody1" align="center">
	<tr>
		<td>Machine Time</td>
		<td>Setup Time</td>
		<td>Notes</td>
		<td>Category</td>
		<td>SubCategory</td>
		<td>Complete</td>
	</tr>
	<tr>
		<td><? echo "".$result["machine_time"]."";?></td>
		<td><? echo "".$result["setup"]."";?></td>
		<td><?echo "".$result["notes"]."";?></td>
		<td><?echo "".$result["cat"]."";?></td>
		<td><? echo "".$result["subcat"]."";?></td>
		<td>
		<select name="complete">
<?
$compsql = "SELECT DISTINCT status FROM complete";
$comp = mysql_query($compsql);
$complete = mysql_fetch_array($comp);


do

{
if($complete['status']==$result['complete'])

{
echo "<option selected value='".$complete['status']."'>".$complete['status']."</option>";

}
else
{
echo "<option value='".$complete['status']."'>".$complete['status']."</option>";

}

} while ($complete = mysql_fetch_array($comp));



?>
</select>
</td>
	</tr>
	<tr>
	<td colspan="6" align="center"><input type="submit" name="finish" value="Confirm Your Time - Finish"></td>
	</tr>
</table>
</form>
<?php
include 'admin_footer.php';
?>

 

 

Link to comment
Share on other sites

I see query string build

 

$update = "UPDATE guestbook SET actual_time='".$_POST['actual_time']."', complete='".$_POST['complete']."', cost='".$_POST['cost']."' WHERE id='$stepid'";

 

But now execute line?

 

mysql_query($update);

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.