Hi all,
I have code as follows, to fetch rows from mysql table. Table it fetches is given below. I want to access now each cell in the table, how do I do that? For e.g, I want to multiply Rank for the Job "transform Brand image by 82% and put it in 4th column to that table.
$sql="SELECT * FROM peoplegrid WHERE Employee ='$name'"; //'".$q."'";
$result = mysql_query($sql);
$row= mysql_fetch_array($result);
//here is where I have tried to access the elements of array
echo $row[0]." - ".$row[3];
echo "<br>";
echo $row[2];
//this is orginal while loop
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Function</th>
<th>City</th>
<th>Rank</th>
<th>Job</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row[0] . "</td>";
echo "<td>" . $row[1] . "</td>";
echo "<td>" . $row[2] . "</td>";
echo "<td>" . $row[3] . "</td>";
echo "<td>" . $row[4] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>