Hi Everyone!
Okay, so for those of you who remember I have been going back and
forth on how to write a reoccuring task manager program for my
office, it's a little bit a labor of love, little bit wanting to
expand my knowledge.
Anyway, I've hit a problem... I am attempting to add away to
reschedule tasks based on a value entered in a text box (IE: 7/3/07)
and then create a timestamp off of that so that I can have it show up
on that date.
The problem comes in when I try and submit the values to the update
form, as of right now, it only picks up the info in the bottom text
box and updates it.... None of the others, no matter how many/few I
have selected to update.
I think I need to put the text boxes into an array (And possibly the
check boxes as well) but I have never done that before for text
boxes.. Is it as easy as textbox[] to create an array of text boxes?
Or is there something else that I'm missing?
Here is some of the code:
$result = mysql_query($sql);
echo "<form method='POST' action='update.php' name='ticklers'>";
echo "<table border='1' bgcolor=".$tableBody." >";
echo "<tr>
<TH>ID #</TH>
<th>Tickler Name</th>
<th>Tickler Description</th>
<TH>Completed</th>
<TH> Day to complete</th>
<TH>Reschedule Date</TH>
</tr>";
while($row = mysql_fetch_array($result)) {
echo "<TR><TD bgcolor=".$rowColor.">ID#, $row[0] </td>";// ID #
echo "<td bgcolor=".$rowColor.">TicklerName, $row[1] </td>";//
Tickler Name
echo "<td bgcolor=".$rowColor.">Instructions, <A href='$row
[2]'>Instructions</A></td>";// Instructions
echo "<td bgcolor=".$dowColor.">DayOfWeekWord, $dowword </td>";//
Day of week word
echo "<TD BGCOLOR=".$rowColor.">DateToReschedule, <input type='text'
name='txtReschedule' value=''>";//Date to reschedule
echo "<TD BGCOLOR=".$rowColor.">DateRescheduled, $Date";//Date
stored in timeStamp
// echo "<TD bgcolor=".$rowColor."><A href='update.php?taskid=$row[0]
&taskdate=$taskdate'>Click here!</A>";
echo "<TD bgcolor=".$rowColor.">CheckboxForWhenDone, <input
type='checkbox' name='chkDone' value='$row[0]'>";//Check box for when
completed
}
and the update form:
$taskdate1= $_POST['txtReschedule'];
$taskDone = $_POST['chkDone'];
$taskTime=mktime($taskdate1);
// $sql="UPDATE tasks SET completed='1', timeStamp='$taskdate1' where
id='$taskid' LIMIT 1;";
$sql="update tasks set completed='1', timeStamp='$taskTime' where
id='$taskDone' LIMIT 1;";
mysql_query($sql) or die(mysql_error());
Any help with this would be greatly appreciated! :)
Jason Pruim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php