Why won't this post?

I’m obviously missing something simple. I returning no errors, I’ve error checked, made sure that all variables are being passed through the pages. Everything SHOULD be working but it’s not updating the database. If you don’t mind, could you take a look and see if you can tell me why? I’m asking it to update by looking at the $id variable which is the line number. Again, thank you! This forum has been a huge help in my quest to learn PHP.

$i=0;
while ($i < $num) {
$id=mysql_result($results,$i,"id");
$sid=mysql_result($results,$i,"sid");
$wperson=mysql_result($results,$i,"wperson");
$student=mysql_result($results,$i,"student");
$hours1=mysql_result($results,$i,"hours1");
$hours2=mysql_result($results,$i,"hours2");
$hours3=mysql_result($results,$i,"hours3");
$hours4=mysql_result($results,$i,"hours4");
$hours5=mysql_result($results,$i,"hours5");
$hours6=mysql_result($results,$i,"hours6");
?>

<form action="volchanged.php" method="post">
<table border='1'>
<th>ID</th>
<th>Student ID</th>
<th>Person Working</th>
<th>Student</th>
<th>March 1st</th>
<th>March 2nd</th>
<th>March 15th</th>
<th>March 16th</th>
<th>April 5th</th>
<th>April 10th</th>
<th>April 11th</th>
<tr>
<td><input type="hidden" size="5" name="ud_id" value="<? echo "$id"?>"></td>
<td><input type="text" size="5" name="ud_sid" value="<? echo "$sid"?>"></td>
<td><input type="text" name="ud_wperson" value="<? echo "$wperson"?>"></td>
<td><input type="text" name="ud_student" value="<? echo "$student"?>"></td>
<td><input type="text" size="6" name="ud_hours1" value="<? echo "$hours1"?>"></td>
<td><input type="text" size="6" name="ud_hours2" value="<? echo "$hours2"?>"></td>
<td><input type="text" size="6" name="ud_hours3" value="<? echo "$hours3"?>"></td>
<td><input type="text" size="6" name="ud_hours4" value="<? echo "$hours4"?>"></td>
<td><input type="text" size="6" name="ud_hours5" value="<? echo "$hours5"?>"></td>
<td><input type="text" size="6" name="ud_hours6" value="<? echo "$hours6"?>"></td></tr>
<BR>
</table>

<input type="Submit" value="Submit">
</form>

<?
++$i;
} 
?>

And the post page:


<?
include 'header.htm';


$ud_id=$_POST['ud_id'];
$ud_sid=$_POST['ud_sid'];
$ud_wperson=$_POST['ud_wperson'];
$ud_student=$_POST['ud_student'];
$ud_hours1=$_POST['ud_hours1'];
$ud_hours2=$_POST['ud_hours2'];
$ud_hours3=$_POST['ud_hours3'];
$ud_hours4=$_POST['ud_hours4'];
$ud_hours5=$_POST['ud_hours5'];
$ud_hours6=$_POST['ud_hours6'];

echo "$ud_id";
echo "<br>";
echo "$ud_hours1";

***DB CONNTECTION SCRIPT HERE***

$query="UPDATE 'volunteer' SET sid='$ud_sid', wperson='$ud_wperson', student='$ud_student', 
       hours1='$ud_hours1', hours2='$ud_hours2', hours3='$ud_hours3',
       hours4='$ud_hours4', hours5='$ud_hours5', hours6='$ud_hours6', WHERE id='$ud_id'"
       or die ("Database could not be updated.");

mysql_query($query);

Thank you again for all of your help!

Hmmm… Seems to me I have seen this somewhere else… OH YEAH, viewtopic.php?f=2&t=8605

Please try not to double post.

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service