The code below works fine but where you see this below
$action = $row['type'] == 1?"was signed by":"was released by";
I want to add in something with it
$row['type'] == 2?"has retired":"has unretired";
I can get the has retired part to show, but when the has unretired part is to take effect it goes to was released by.
any ideas on what i might be doing wrong???
<?php
function registration_log(){
global $u, $sessionid;
include("config.php");
$open = mysql_connect($hostname, $user, $password);
mysql_select_db("$db", $open);
$html = "
<p class=\"header\" align=center>Player Registration Log</p>
<table width=\"600\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">
<tr bgcolor=\"#dfdfdf\" align=\"center\">
<td class=\"table_header\">Player</td>
<td class=\"table_header\">Action</td>
<td class=\"table_header\">Team</td>
<td class=\"table_header\">Date</td>
</tr>";
$results = mysql_query("SELECT * FROM `register_log` ORDER BY timestamp DESC LIMIT 30");
$i = 1;
while($row = mysql_fetch_assoc($results)){
$player = mysql_fetch_assoc(mysql_query("SELECT * FROM `players` WHERE id = '" . $row['playerid'] . "'"));
$team = mysql_fetch_assoc(mysql_query("SELECT * FROM `teams` WHERE id = '" . $row['teamid'] . "'"));
[COLOR="Red"] $action = $row['type'] == 1?"was signed by":"was released by";[/COLOR] $date = date("m.d.y", $row['timestamp']);
$bgcolor = is_int($i / 2)?"#ffffff":"#efefef";
$html .= "
<tr bgcolor=\"" . $bgcolor . "\" align=\"center\">
<td class=\"table_text\"><a href=\"./?opt=viewplayer&pid=" . $player['id'] . "\">" . $player['fname'] . " " . $player['lname'] . "</a> (" . $player['position'] . ")</td>
<td class=\"table_text\">[COLOR="red"]" . $action . "</[/COLOR]td>
<td class=\"table_text\"><a href=\"./?opt=viewteam&id=" . $team['id'] . "\">" . $team['name'] . "</a></td>
<td class=\"table_text\">" . $date . "</td>
</tr>";
$i++;
}
$html .= "</table><br />
<p class=\"body_text\" align=center>Latest log entries are at the top.</p>";
mysql_close($open);
return $html;
}
?>