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
https://forums.phpfreaks.com/topic/60846-why-will-this-not-update/
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.