Hi all
Thanks for the assistance so far.
I've got my page.
<?php
$sql2 = "SELECT * FROM Available_Workload
WHERE StartDate BETWEEN '{$_SESSION['now']}'
AND '{$_SESSION['importantdate']}'
AND Available='Yes' ORDER BY ID";
$result2 = mysql_query($sql2)
or die ("Couldn't execute query for result2");
$row = mysql_fetch_array($result2) or die(mysql_error());
/*Display results in a table*/
echo "<form action=' ' method='post' name='select' id='select'>";
echo "<table cellspacing='2' border='0' cellpadding='0' width='702' style='text-align: center' style='font-size: smaller'>";
echo "<tr>\n";
echo "<td width='107'><h3>StartDate</h3></td>\n";
echo "<td width='132'><h3>EndDate</h3></td>\n";
echo "<td width='156'><h3>Areas</h3></td>\n";
echo "<td width='95'><h3>Quantity</h3></td>\n";
echo "<td width='200'><h3>Email Selection</h3></td>\n";
echo "</tr>\n";
echo "<tr>
<td colspan='5' align='center'>
<hr>
</td>
</tr>\n";
while($row = mysql_fetch_array($result2,MYSQL_ASSOC))
{
$StartDate = date_create($row['StartDate']);
$f_StartDate = date_format(date_create($row['StartDate']), 'j,M,Y');
$EndDate = date_create($row['EndDate']);
$f_EndDate = date_format(date_create($row['EndDate']), 'j,M,Y');
/*Display row for each available job*/
echo "<tr>\n";
echo "<td>$f_StartDate</td>\n";
echo "<td>$f_EndDate</td>\n";
echo "<td>{$row['Areas']}</td>\n";
echo "<td>{$row['Quantity']}</td>\n";
echo "<td><input name='{$row['ID']}' type='text' size='20'></td>\n";
echo "</tr>\n";
}
echo "<tr>
<td colspan='6'>
<hr>
</td>
</tr>\n";
echo "<tr>
<td colspan='6' align='center'>
<input type='submit' name='submit' id='submit' value='Confirm Selection'>
</td>
</tr>\n";
echo "</table></form>\n";
?>
which gives me a nice table with form fields to select relevant job.
Now please I need help processing this form.
I want to update my database table to change Available from 'Yes' to 'No' where the ID = row and to insert the posted field (which will be email username) into Username column of the same row.
(EDIT) at this time the user will be asked to select one or more boxes. If this is an issue I can make an interim page with question (do you want to select more? yes=redirect/back no=redirect success.htm. Which means we could concentrate on only one selection at a time.(EDIT)
Then to email all the details to our info address and redirect the user to success.htm
Please anyone anything at all
Thank you
Arnora