ok yes you are right, i have made some changes
here is my code below at the momment i have two forms and two submit buttons. At the momment im trying to get the details form to work. i can get it to post to the database, but i also want it to post to same page at the bttom so that people can read the action_taken. ata the momment it's not outputting in properly in my html table. no content is being out putted
<html>
<head>
</head>
<body>
<?php
$jobId=$_GET['jobId'];
mysql_connect("localhost","phpuser","phpuser03") or die ("Database connection error");
mysql_select_db( helpdesk);
$sql = "select jobId, email, room, computers, description, date FROM requests_table
WHERE requests_table.jobId='$jobId'";
$result = mysql_query($sql);
echo mysql_error() ;
echo "<table>\n";
echo " <tr>\n";
echo " <th><b>JobID</b></th>\n";
echo " <th><b>email</b></th>\n";
echo " <th><b>Room</b></th>\n";
echo " <th><b>Computers</b></th>\n";
echo " <th><b>description</b></th>\n";
echo " <th><b>date & time</b></th>\n";
echo " </tr>\n";
while ($row = mysql_fetch_array($result)) {
echo '<td>'.$row['jobId'].'</td>';
echo '<td>'.$row['email'].'</td>';
echo '<td>'.$row['room'].'</td>';
echo ' <td>'.$row['computers'].'</td>'."\n";
echo ' <td>'.$row['description'].'</td>'."\n";
echo ' <td>'.$row['date'].'</td>'."\n";
echo '</tr>'."\n";
echo '</table>';
}
?>
<br>
<br>
<form name="details" method="post" action= "<? echo $_SERVER['PHP_SELF'] . "?jobId=" . $jobId; ?>">
<table width="374" height="160" border="0">
<tr>
<th width="54" scope="row">TechId</th>
<td width="250"><strong>Action taken </strong></td>
<td width="56"> </td>
</tr>
<tr>
<th scope="row"><input name="Tech_initals" type="text" size="8" maxlength="5"></th>
<td><textarea name="action_taken" cols="35" rows="5"></textarea></td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="submit" name="Submit1" value="Submit"></td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<form name="form2" method="post" action="">
<table width="374" height="160" border="0">
<tr>
<th width="54" scope="row">Status of job </th>
<td width="250"><strong>Email comment </strong></td>
<td width="56"> </td>
</tr>
<tr>
<th scope="row"><input name="techId" type="text" size="8" maxlength="5"></th>
<td><textarea name="action_taken" cols="35" rows="5"></textarea></td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="submit" name="Submit" value="Submit"></td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<?php
$color[0] = "FCFCFC";
$color[1] = " 34ADE5 ";
$jobId=$GET['jobId'];
$action_taken=$GET['action_taken'];
$Tech_initals=$_GET['Tech_intials'];
if($_POST["Submit1"]) {
$action_taken = addslashes($POST['action_taken']);
$Tech_initals = addslashes($POST['Tech_initals']);
$db = @mysql_connect('localhost', 'phpuser', 'phpuser03') or die('Could not connect to the database: '.mysql_error());
@mysql_select_db('helpdesk') or die('Could not select the database: '.mysql_error());
$result = mysql_query('INSERT INTO tech_table (jobId, Tech_initals, action_taken, date)'.
"VALUES ('$jobId','$Tech_initals','$action_taken', NOW())") or die('Unable to insert record. '.mysql_error());
$sql = "SELECT 'jobId', 'Tech_initials', 'action_taken', 'date' FROM tech_table" ;
$result = mysql_query($sql);
echo "<table>\n";
echo " <tr>\n";
echo " <th><b>JobID</b></th>\n";
echo " <th><b>Tech Initals</b></th>\n";
echo " <th><b>Action taken</b></th>\n";
echo " <th><b>Date</b></th>\n";
echo " </tr>\n";
while ($row = mysql_fetch_array($result)) {
//print_r($result) ;
// echo mysql_error() ;
$a = ($a+1)%2;
echo '<tr bgcolor='.$color[$a] . ">\n";
echo '<td>'.$row['jobId'].'</td>';
echo ' <td>'.$row['Tech_initals'].'</td>'."\n";
echo ' <td>'.$row['action_taken'].'</td>'."\n";
echo ' <td>'.$row['date'].'</td>'."\n";
echo '</tr>'."\n";
//echo '</table>';
}}
?>
</body>
</html>