I am not getting the proper representation of an HTML table after inserting php code in "td" tag while the code is is php page only so that server can execute the code inside the "td" tag. Following is the code :
<table border=1>
<tr>
<td><select name="designer_response" id="designer_response" <?php if($variable == 0)echo 'disabled=disabled' ?> ><option value="Yes">Yes</option><option value="No">No</option></select></td>
<td><textarea name="designer_comments" id="designer_comments"><?php echo "".$designer_c ?></textarea></td>
<td><select name="reviewer_response" id="reviewer_response"><option value="Yes">Yes</option value="No"><option>No</option></select></td>
<td><textarea name="reviewer_comments" id="reviewer_comments"><?php echo "".$reviewer_c ?></textarea></td>
</tr>
</table>
Thanks...
Please find the php code that modifies and defines the variables in the code snppet given above :
<?php
$id = 'Q420';
$phase_of_review = 0;
$designereviewer_r = "";
$designereviewer_c = "";
$reviewer_r = "";
$reviewer_c = "";
$con = mysql_connect("localhost","root","");
mysql_select_db("checklist", $con);
//Extracting data...
$s = "select * from dummy";
$resource = mysql_query($s , $con);
if($resource == TRUE)
{
//Yes data is there , fetch it ..
$data = mysql_fetch_assoc($resource);
$designer_r = $data['designer_response'];
$designer_c = $data['designer_comments'];
$reviewer_r = $data['reviewer_response'];
$reviewer_c = $data['reviewer_comments'];
echo "designer_response".$designer_r;
}
else
$phase_of_review = 1;
$variable = 1;
?>
Below is the output html of the php code given above:
<table border=1 bordercolor="black">
<tr>
<td><select name="designer_response" id="designer_response" ><optionvalue="Yes">Yes</option><option value="No">No</option></select></td>
<td><textarea name="designer_comments" id="designer_comments">ok2</textarea></td>
<td><select name="reviewer_response" id="reviewer_response"><option value="Yes">Yes</option value="No"><option>No</option></select></td>
<td><textarea name="reviewer_comments" id="reviewer_comments">ok3</textarea></td>
</tr>
</table>