wysiwygGER01
Programmer
Hi,
The code below returns a list of tasks. Each task has an ID.
I'd like to be able to modify each task by clicking on 'modify'
So far I'd just like it to show me the new query if I click on modify but I can't get it to jump into the IF block.
Could anyone here please advise what I'm missing or point me to a working example so I can look for myself?
Thanks in advance.
The code below returns a list of tasks. Each task has an ID.
I'd like to be able to modify each task by clicking on 'modify'
So far I'd just like it to show me the new query if I click on modify but I can't get it to jump into the IF block.
Could anyone here please advise what I'm missing or point me to a working example so I can look for myself?
Thanks in advance.
Code:
<table>
<tbody>
<?php
$action = $_GET['action'];
IF($action == "modify")
{
$query_role="SELECT Tasks FROM jobdescription2 where TaskID = '????'";
echo "$query_role";
}
ELSE{
$query_role="SELECT Tasks, TaskID FROM jobdescription2 where roles = 'Admin'";
}
?>
<form name="form_modify" action="<?php $_SESSION['PHP_SELF']?>">
<?php
$con = odbc_connect( 'database' , 'root', 'test' );
$result = odbc_exec($con, $query_role);
$num_rows= odbc_num_rows($result);
for($count =1; $count <= $num_rows; $count++)
{
odbc_fetch_row($result,$count); // fetch the succesive result rows
$taskID= odbc_result( $result, 2 );
echo "<tr>
<td>".$taskID."</td><td>".odbc_result( $result, 1 )."</td>
<td><a href=".$_SERVER 'PHP_SELF']."?action=modify=".$taskID.">modify</a></td>
</tr>";
}
odbc_close( $con);
?>
</form>
</tbody>
</table>