Copy link to clipboard
Copied
I am outputting my table data, and would like to modify it several ways. One way is to check if the account status is set to 1, change the color to red and bold it. also, i do not want to show the password field. lastly, i would like to modify the table so that I can insert a Modify Account link. here is what I have at the moment:
echo "<table border='3' cellpadding='5'><tr> <th>ID</th> <th>Name</th> <th>Username</th> <th>Password</th> <th>E-mail</th> <th>Account Activation</th> <th>Account Type</th> <th>Account Status</th> <th>Amount of Banwhitch Used</th> <th>Modify Account</th>";
for ($j = 0; $j < $rows; ++$j)
{
$row = mysql_fetch_row($result);
echo"<tr>";
for ($k = 0; $k<9; ++$k)
{
echo "<td>$row[$k]</td>";
}
echo "</tr>";
}
echo "</table>";
thanks
Copy link to clipboard
Copied
future-architect wrote:
I am outputting my table data, and would like to modify it several ways.
Use conditional statements.
for ($j = 0; $j < $rows; ++$j)
{
$row = mysql_fetch_row($result);
echo"<tr>";
for ($k = 0; $k<10; $k++)
{
// don't show password
if ($k == 3) {
echo "<td>******</td>";
}
// check status
elseif ($k == 7 && $row[$k] == 1) {
echo "<td style='color:red;font-weight:bold'>$row[$k]</td>";
]
// create link
elseif ($k == 9) {
// create link using $row[0] (ID)
}
else {
echo "<td>$row[$k]</td>";
}
}
echo "</tr>";
}
Message was edited by: David_Powers amending code for password.
Copy link to clipboard
Copied
nevermind, got it to work ![]()
Message was edited by: future-architect
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more